test
This commit is contained in:
parent
bc5a651fe6
commit
33ae51bab6
52
index.js
52
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user