mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-03 15:07:35 +02:00
23 lines
693 B
TypeScript
23 lines
693 B
TypeScript
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");
|
|
}
|
|
}
|
|
}
|
|
}; |