This commit is contained in:
Ecolipsy 2021-12-02 18:40:23 +01:00
parent c46567e831
commit beff32bb38

View file

@ -204,17 +204,14 @@ client.on("messageCreate", (msg) => {
if (!msg.guild) return msg.channel.send("Cant do in dms lol")
i++;
console.log("Got to %s!", i);
const commandName = args.shift().toLowerCase() //gets what the commands name is and makes it lowercase so it aint case sensitive
i++;
console.log("Got to %s!", i);
const command = client.commands.get(commandName) //gets the actual command object
try{
i++;
console.log("Got to %s!", i);
command.execute(msg, args)
cmd.execute(msg, args)
} catch (error) {
console.error(error)
msg.reply("There was an error while executing this command! (the error has been logged)")