diff --git a/events/client/interactionCreate.js b/events/client/interactionCreate.js index b1e0f4f..907fcb8 100644 --- a/events/client/interactionCreate.js +++ b/events/client/interactionCreate.js @@ -2,7 +2,7 @@ const { Events, InteractionType } = require("discord.js"); module.exports = { name: Events.InteractionCreate, - async run(client, interaction) { + async execute(client, interaction) { if (interaction.type === InteractionType.ApplicationCommand) { const command = client.commands.get(interaction.commandName); await command.execute(interaction, client); diff --git a/events/gestion/bl.js b/events/gestion/bl.js new file mode 100644 index 0000000..5a8931a --- /dev/null +++ b/events/gestion/bl.js @@ -0,0 +1,18 @@ +const { Events } = require("discord.js"); +const db = require('quick.db'); +const GestionDb = new db.table('gestion') +module.exports = { + name: Events.GuildMemberAdd, + once: false, + async execute(member, client) { + const userId = member.user.id; + const bl = await GestionDb.get(`${client.user.id}.bl`); + + if (bl && bl[userId]) { + try { + await member.ban({ reason: 'Blacklisted' }); + } catch (error) { + } + } + }, +}; \ No newline at end of file diff --git a/events/gestion/messageDelete.js b/events/gestion/messageDelete.js index 1fab88b..238a99c 100644 --- a/events/gestion/messageDelete.js +++ b/events/gestion/messageDelete.js @@ -1,11 +1,9 @@ module.exports = { name: 'messageDelete', once: false, - execute(message, client) { - // Ignore les messages de bots + async execute(message, client) { if (message.author.bot) return; - // Enregistre le message supprimé dans la collection snipes client.snipes.set(message.channel.id, { content: message.content, author: message.author.id, diff --git a/loaders/loadCommands.js b/loaders/loadCommands.js index 0ea5cda..b73621d 100644 --- a/loaders/loadCommands.js +++ b/loaders/loadCommands.js @@ -82,4 +82,4 @@ module.exports = (client) => { } } }); -} \ No newline at end of file +}