Double registering

Discord double registers my commands. Basically I edited my code (the commands file code) and instead of replacing it, it created a new one and kept the old one. index.js: https://sourceb.in/MRyhH8VDc7 commands.js: https://sourceb.in/l9Bh6VBaSZ commands/lawcodes.js: https://sourceb.in/3xuIfoH583 Can you help me make my bot only register the correct one ONCE?
4 Replies
d.js toolkit
d.js toolkit3w 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! - Marked as resolved by OP
d.js docs
d.js docs3w ago
If you have duplicate commands on your server, you registered both global and guild commands. You can remove the duplicates by resetting either the global or guild commands - Resetting global commands: rest.put(Routes.applicationCommands(clientId), { body: [] }) - Resetting guild commands: rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
treble/luna
treble/luna3w ago
also there is no need to reset your commands PUT overrides
BMmarci1234
BMmarci1234OP3w ago
Thanks. Now it works.

Did you find this page helpful?