add uptime cmd

master
Kit Kasune 4 years ago
parent 4b6e61f066
commit d4fdb56115
  1. 20
      commands/fun/spotify.js
  2. 29
      commands/misc/uptime.js
  3. 15
      package-lock.json
  4. 1
      package.json

@ -1,20 +0,0 @@
const Discord = require('discord.js');
const spotify = require('swwrap');
module.exports = {
name: "",
aliases: [],
meta: {
category: '',
description: "",
syntax: '` <>`',
extra: null
},
help: new Discord.MessageEmbed()
.setTitle("Help -> ")
.setDescription("")
.addField("Syntax", "``"),
async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);}
}
};

@ -0,0 +1,29 @@
const Discord = require('discord.js');
const Bot = require('../../models/bot');
const moment = require('moment');
require('moment-precise-range-plugin');
module.exports = {
name: "uptime",
aliases: ['ut', 'up'],
meta: {
category: 'Misc',
description: "Shows the bot's uptime",
syntax: '`uptime`',
extra: null
},
help: "Shows my uptime, which is how long it's been since my last restart.",
async execute(message, msg, args, cmd, prefix, mention, client) {
const bot = await Bot.findOne({finder: 'lel'});
return message.channel.send(new Discord.MessageEmbed()
.setTitle("Uptime")
.setThumbnail(client.user.avatarURL({size: 2048}))
.setDescription(moment.preciseDiff(moment(bot.lastRestart), moment()))
.setColor('c375f0')
.setFooter("Natsuki")
.setTimestamp()
)
}
};

15
package-lock.json generated

@ -15,6 +15,7 @@
"discord.js": "^12.2.0", "discord.js": "^12.2.0",
"manyitems": "^1.0.2", "manyitems": "^1.0.2",
"moment": "^2.28.0", "moment": "^2.28.0",
"moment-precise-range-plugin": "^1.3.0",
"mongoose": "^5.10.3", "mongoose": "^5.10.3",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"ora": "^5.3.0", "ora": "^5.3.0",
@ -823,6 +824,14 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/moment-precise-range-plugin": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/moment-precise-range-plugin/-/moment-precise-range-plugin-1.3.0.tgz",
"integrity": "sha1-YKwHX9/RRon20QKvdR0XGoC0q2A=",
"peerDependencies": {
"moment": ">=2.9.0"
}
},
"node_modules/mongodb": { "node_modules/mongodb": {
"version": "3.6.4", "version": "3.6.4",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.4.tgz", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.4.tgz",
@ -2266,6 +2275,12 @@
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
}, },
"moment-precise-range-plugin": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/moment-precise-range-plugin/-/moment-precise-range-plugin-1.3.0.tgz",
"integrity": "sha1-YKwHX9/RRon20QKvdR0XGoC0q2A=",
"requires": {}
},
"mongodb": { "mongodb": {
"version": "3.6.4", "version": "3.6.4",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.4.tgz", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.4.tgz",

@ -12,6 +12,7 @@
"discord.js": "^12.2.0", "discord.js": "^12.2.0",
"manyitems": "^1.0.2", "manyitems": "^1.0.2",
"moment": "^2.28.0", "moment": "^2.28.0",
"moment-precise-range-plugin": "^1.3.0",
"mongoose": "^5.10.3", "mongoose": "^5.10.3",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"ora": "^5.3.0", "ora": "^5.3.0",

Loading…
Cancel
Save