diff options
| author | 8cy <[email protected]> | 2020-04-08 02:03:40 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-08 02:03:40 -0700 |
| commit | 06604e6d432c2a82e151f7d2b1776d8546bd2389 (patch) | |
| tree | fc736bb459f301aa23fe7a193586214860b1226b | |
| parent | add custom to botstatus types, v1.4.2 (diff) | |
| download | s5nical-06604e6d432c2a82e151f7d2b1776d8546bd2389.tar.xz s5nical-06604e6d432c2a82e151f7d2b1776d8546bd2389.zip | |
fix uptime, v1.4.3
| -rw-r--r-- | app.js | 20 | ||||
| -rw-r--r-- | commands/uptime.js | 8 |
2 files changed, 18 insertions, 10 deletions
@@ -114,6 +114,14 @@ bot.on('message', async msg => { if (msg.member.hasPermission(p)) return true;
}
+ function connectionCheck() {
+ if (msg.guild.voiceConnection) {
+ msg.reply('i\'m already playing that lol');
+ } else {
+ msg.reply('you need to join a voice channel first silly');
+ }
+ }
+
// Cooldown check
// TODO: implament cooldowns when needed https://discordjs.guide/command-handling/adding-features.html#cooldowns
@@ -121,11 +129,8 @@ bot.on('message', async msg => { try {
const cmd = bot.commands.get(command) || bot.commands.find(c => c.aliases && c.aliases.includes(command));
- if (!cmd) {
- msg.reply('thats not a command silly');
- } else if (cmd) {
- cmd.execute(msg, args, bot);
- }
+ if (!cmd) return;
+ cmd.execute(msg, args, bot, duration);
return;
} catch (error) {
console.error(error);
@@ -133,11 +138,6 @@ bot.on('message', async msg => { return;
}
- // Small command which need app.js variables
- if (command == 'uptime' | command == 'ut') {
- msg.reply(duration);
- }
-
// Reacts with ping emoji when @everyone
if (msg.mentions.everyone) {
msg.react(':ArisaPing:695887537390223402');
diff --git a/commands/uptime.js b/commands/uptime.js new file mode 100644 index 0000000..f6dbefd --- /dev/null +++ b/commands/uptime.js @@ -0,0 +1,8 @@ +module.exports = { + name: 'uptime', + aliases: ['ut'], + description: '', + async execute(msg, args, bot, duration) { + msg.reply(duration); + } +};
\ No newline at end of file |