add structure for simplifie creation of global command

This commit is contained in:
Arthur Puechberty
2026-01-17 15:13:22 +01:00
parent 08647924e3
commit d5f0f4c30b
11 changed files with 593 additions and 17 deletions
+3 -4
View File
@@ -7,6 +7,9 @@ const e = require('express');
const client = new Client({ intents: Object.values(GatewayIntentBits) });
require("./loader/events.js")(client);
require("./loader/commands.js")(client);
client.once(Events.ClientReady, async () => {
console.log(`Bot connecté en tant que ${client.user.tag}`);
await loadSlashCommands(client);
@@ -17,10 +20,6 @@ client.once(Events.ClientReady, async () => {
client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === 'ping') {
await interaction.reply('Pong!');
}
else if (interaction.commandName === 'level') {
const guildId = interaction.guild.id;
const userId = interaction.user.id;