mirror of
https://github.com/arthur-pbty/LazyBot.git
synced 2026-06-03 23:36:37 +02:00
add structure for simplifie creation of global command
This commit is contained in:
+3
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user