modif de la commande deploy to fit all guilds

This commit is contained in:
Nemo 2021-11-14 02:29:42 +01:00
parent 6471c772ce
commit cc6f70c41a
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
const fs = require('fs');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { clientId, guildId, token } = require('./config.json');
const { clientId, token } = require('./config.json');
const commands = []
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
@ -13,6 +13,6 @@ for (const file of commandFiles) {
const rest = new REST({ version: '9' }).setToken(token);
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
rest.put(Routes.applicationCommands(clientId), { body: commands })
.then(() => console.log('Successfully registered application commands.'))
.catch(console.error);