modif de la commande deploy to fit all guilds
This commit is contained in:
parent
6471c772ce
commit
cc6f70c41a
@ -1,7 +1,7 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { REST } = require('@discordjs/rest');
|
const { REST } = require('@discordjs/rest');
|
||||||
const { Routes } = require('discord-api-types/v9');
|
const { Routes } = require('discord-api-types/v9');
|
||||||
const { clientId, guildId, token } = require('./config.json');
|
const { clientId, token } = require('./config.json');
|
||||||
|
|
||||||
const commands = []
|
const commands = []
|
||||||
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
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);
|
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.'))
|
.then(() => console.log('Successfully registered application commands.'))
|
||||||
.catch(console.error);
|
.catch(console.error);
|
Loading…
Reference in New Issue
Block a user