From 33ae51bab6bde43fc9a5bfb09fa5d59be279f442 Mon Sep 17 00:00:00 2001 From: Louis Mazin Date: Tue, 1 Jul 2025 15:58:36 +0200 Subject: [PATCH] test --- index.js | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/index.js b/index.js index df6ca73..df8c32a 100644 --- a/index.js +++ b/index.js @@ -47,32 +47,6 @@ client.on('ready', () => { deploy(token); }); -client.on(Events.InteractionCreate, async interaction => { - if (!interaction.isChatInputCommand()) return; - - const command = interaction.client.commands.get(interaction.commandName); - - if (!command) { - console.error(`No command matching ${interaction.commandName} was found.`); - return; - } - - try { - if (interaction.commandName === 'server-stats') { - await command.execute(interaction, palworldToken); - }else{ - await command.execute(interaction); - } - } catch (error) { - console.error(error); - if (interaction.replied || interaction.deferred) { - await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true }); - } else { - await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); - } - } -}); - client.on(Events.MessageReactionAdd, async (reaction, user) => { console.log('=== ÉVÉNEMENT REÇU ==='); console.log('Emoji:', reaction.emoji.name); @@ -119,6 +93,32 @@ client.on(Events.MessageReactionAdd, async (reaction, user) => { } }); +client.on(Events.InteractionCreate, async interaction => { + if (!interaction.isChatInputCommand()) return; + + const command = interaction.client.commands.get(interaction.commandName); + + if (!command) { + console.error(`No command matching ${interaction.commandName} was found.`); + return; + } + + try { + if (interaction.commandName === 'server-stats') { + await command.execute(interaction, palworldToken); + }else{ + await command.execute(interaction); + } + } catch (error) { + console.error(error); + if (interaction.replied || interaction.deferred) { + await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true }); + } else { + await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); + } + } +}); + client.login(token); setInterval(()=>{update(headers,numbers,client,palworldToken)}, 300000);