improved basic commands

This commit is contained in:
Hazem Krimi
2020-04-29 10:46:29 +01:00
parent a300187aa4
commit 3acb006f43
3 changed files with 14 additions and 4 deletions
+1 -2
View File
@@ -18,14 +18,13 @@ client.on('message', async message => {
const args = message.content.slice(process.env.PREFIX.length).split(/ +/);
const commandName = args.shift().toLowerCase();
const voiceChannel = message.member.voice.channel;
if (!client.commands.has(commandName)) return message.reply('this command does not exist!');
const command = client.commands.get(commandName);
try {
command.execute(message, voiceChannel, args);
command.execute(message, args);
} catch (error) {
console.error(error);
message.reply('there was an error trying to execute that command!');