Update index.js

This commit is contained in:
Wizzard 2024-09-08 10:52:56 -04:00
parent 3317bd0273
commit 90287d8f2c
1 changed files with 5 additions and 2 deletions

View File

@ -29,7 +29,11 @@ client.on('messageCreate', async message => {
if (!client.commands.has(commandName)) return; if (!client.commands.has(commandName)) return;
message.delete(); const deleteDelay = 2000;
setTimeout(() => {
message.delete().catch(console.error);
}, deleteDelay);
try { try {
await client.commands.get(commandName).execute(message, args, MESSAGE_DELETE_TIMEOUT); await client.commands.get(commandName).execute(message, args, MESSAGE_DELETE_TIMEOUT);
@ -42,5 +46,4 @@ client.on('messageCreate', async message => {
} }
}); });
client.login(process.env.DISCORD_TOKEN); client.login(process.env.DISCORD_TOKEN);