Weird slash command registering problem

Hello, i'm having a weird issue where not logging (console.log) the result of rest.put does not register the slash command Not working:
for (const [guild, commands] of Object.entries(guildCommands)) {
console.log(chalk.cyan(`Started reloading "${guild}" (/)`));
const data = await rest.put(
Routes.applicationGuildCommands(config.clientId, guild),
{ body: commands },
);
console.log(chalk.green(`Reloaded ${commands.length} commands for "${guild}"`))
}
for (const [guild, commands] of Object.entries(guildCommands)) {
console.log(chalk.cyan(`Started reloading "${guild}" (/)`));
const data = await rest.put(
Routes.applicationGuildCommands(config.clientId, guild),
{ body: commands },
);
console.log(chalk.green(`Reloaded ${commands.length} commands for "${guild}"`))
}
Working:
for (const [guild, commands] of Object.entries(guildCommands)) {
console.log(chalk.cyan(`Started reloading "${guild}" (/)`));
const data = await rest.put(
Routes.applicationGuildCommands(config.clientId, guild),
{ body: commands },
);
console.log(data) // here
console.log(chalk.green(`Reloaded ${commands.length} commands for "${guild}"`))
for (const [guild, commands] of Object.entries(guildCommands)) {
console.log(chalk.cyan(`Started reloading "${guild}" (/)`));
const data = await rest.put(
Routes.applicationGuildCommands(config.clientId, guild),
{ body: commands },
);
console.log(data) // here
console.log(chalk.green(`Reloaded ${commands.length} commands for "${guild}"`))
}
2 Replies
d.js toolkit
d.js toolkit9mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Ori
Ori9mo ago
Should I send the whole file? I can't find why it does this... Well, it simply didn't registered the global command. So for debugging purposes, i added console.log. It showed that the commands did exist, and it suddendly started to work again. Then when I removed the log thinking it was somehow fixed, it broke again. It strangely resolved itself… I will see if it happens again