Update index.js

This commit is contained in:
Murat 2023-11-29 20:01:04 +03:00 committed by GitHub
parent 5530c40d58
commit 9d71d4cd9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ client.on('messageCreate', async message => {
let command = args.shift().toLowerCase() // Getting the command from args
let cmd;
if (client.commands.has(command)) cmd = client.commands.get(command) // Checking if typed command is exists
if (cmd) cmd.run(client, message, args) // Running the command if it is exists
if (cmd && cmd.info.enabled) cmd.run(client, message, args) // Running the command if it is exists
})
client.on('ready', () => console.log('Bot is ready!')) // Ready Event