This commit is contained in:
Louis Mazin 2025-11-30 16:24:20 +01:00
parent 9ea2adf2f3
commit 1975a4476d

View File

@ -2,7 +2,6 @@ const { REST, Routes } = require('discord.js');
const fs = require('node:fs'); const fs = require('node:fs');
const path = require('node:path'); const path = require('node:path');
module.exports = (token) => { module.exports = (token) => {
const guildIds = ["1230809896744779777","1068240252092813373"];
const commands = []; const commands = [];
// Grab all the command folders from the commands directory you created earlier // Grab all the command folders from the commands directory you created earlier
const foldersPath = path.join(__dirname, 'commands'); const foldersPath = path.join(__dirname, 'commands');
@ -29,14 +28,11 @@ module.exports = (token) => {
// and deploy your commands! // and deploy your commands!
(async () => { (async () => {
try { try {
// The put method is used to fully refresh all commands in the guild with the current set
for(const guildId of guildIds){
console.log(`Started refreshing ${commands.length} application (/) commands.`); console.log(`Started refreshing ${commands.length} application (/) commands.`);
const data = await rest.put( const data = await rest.put(
Routes.applicationGuildCommands(1256304109393547305n, guildId), Routes.applicationGuildCommands(1256304109393547305n, "1068240252092813373"),
{ body: commands }, { body: commands },
).then(data=>console.log(`Successfully reloaded ${data.length} application (/) commands.`)) ).then(data=>console.log(`Successfully reloaded ${data.length} application (/) commands.`))
}
} catch (error) { } catch (error) {
// And of course, make sure you catch and log any errors! // And of course, make sure you catch and log any errors!
console.error(error); console.error(error);