This commit is contained in:
Tutur33
2024-03-02 21:15:14 +01:00
parent 90da5b1a97
commit 95daf7ef0f
10 changed files with 804 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { Message, Events } from "discord.js";
module.exports = {
name: Events.MessageCreate,
async execute(message: Message, client: any) {
if (!message.author.id === client.user.id) return;
const prefix = '!!'
if (message.content.startsWith(prefix)) {
const args = message.content.slice(prefix.length).trim().split(/ +/);
const commandName = args.shift()?.toLowerCase();
const command = client.commands.get(commandName);
if (!command) return;
try {
command.execute(message, args, client);
} catch (error) {
console.error(error);
message.edit("Erreur lors de l'exécution de la commande");
}
}
}
};