-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (22 loc) · 941 Bytes
/
Copy pathindex.js
File metadata and controls
29 lines (22 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const fs = require('fs');
const { Client, Collection, Intents } = require('discord.js');
const { token } = require('./config.json');
const handleCommand = require('./helpers/command');
const handleSelectMenu = require('./helpers/select-menu');
const { name } = require('./commands/userinfos');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
client.commands = new Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
const newVariableName = name
for (const file of commandFiles) {
const command = require(`./deploy-commands`);
client.commands.set(command.data.name, command);
}
client.once('ready', () => {
console.log('Je suis prêt !');
});
client.on('interactionCreate', async interaction => {
if (interaction.isCommand()) handleCommand(client, interaction);
if (interaction.isSelectMenu()) handleSelectMenu(interaction);
});
client.login(token);