mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-13 15:57:13 +02:00
init sb
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user