diff --git a/index.js b/index.js index 3f31144..28131e6 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ const update = require('./displayer.js'); const clean = require('./cleaner.js'); const { Client, GatewayIntentBits, Collection, Events } = require('discord.js'); -const client = new Client({ intents: [GatewayIntentBits.GuildMembers,GatewayIntentBits.GuildMessages] }); +const client = new Client({ intents: [GatewayIntentBits.GuildMembers,GatewayIntentBits.GuildMessages,GatewayIntentBits.GuildMessageReactions] }); const args = process.argv; const token = args[2].toString(); const pterodactyl = args[3].toString(); @@ -73,12 +73,12 @@ client.on(Events.InteractionCreate, async interaction => { } }); -client.on(Events.MessageReactionAdd, async (reaction, user, details) => { - // Ignorer les réactions du bot lui-même +client.on(Events.MessageReactionAdd, async (reaction, user) => { + if (user.bot) return; - // Vérifier si c'est l'emoji ❓ + if (reaction.emoji.name !== '❓') return; - // Vérifier si DeepL est configuré + if (!translator) { console.log('DeepL token not provided, translation feature disabled'); return;