diff options
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 20 |
1 files changed, 10 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');
|