This commit is contained in:
Louis Mazin 2025-07-01 15:28:53 +02:00
parent 98c6a04f3e
commit f0c6b15974

View File

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