TheBear259
TheBear259
DIAdiscord.js - Imagine an app
Created by TheBear259 on 3/29/2025 in #djs-questions
Global commands not deploying
// and deploy your commands!
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`);

// The put method is used to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationGuildCommands(clientId, guildId),
{ body: commands },
);

console.log(`Successfully reloaded ${data.length} application (/) commands.`);
} catch (error) {
// And of course, make sure you catch and log any errors!
console.error(error);
}
})();
// and deploy your commands!
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`);

// The put method is used to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationGuildCommands(clientId, guildId),
{ body: commands },
);

console.log(`Successfully reloaded ${data.length} application (/) commands.`);
} catch (error) {
// And of course, make sure you catch and log any errors!
console.error(error);
}
})();
I tried to add my bot to a friends server and the commands were not there. When I deployed using the deploy-commands.js as written in the discord.js guide the console log said it successfully reloaded the commands but none ever showed up. The bot has the applications.command scope, however when I change the deploy file to use applicationGuildCommands it deployed them correctly and instantly (I moved back to my test server and removed then re-added my bot). I do not believe it is a rate limit as it was my first time doing it today. I am currently using discord.js 14.17.3 and node 22.13.0
115 replies