Kbone22
DIdiscord.js - Imagine ❄
•Created by Kbone22 on 1/17/2025 in #djs-questions
Issue with Duplicate Commands When Bot Is Added to Another Server
Hi everyone, I’m facing an issue with my bot’s deploy script, and I’d appreciate your help in resolving it.
Here’s the situation:
1. The bot works perfectly when added to a new server via top.gg. Commands deploy as expected, with global commands available and no duplication.
2. The bot is also in an admin server (used for managing guild-specific commands). In this admin server, both global commands and admin commands work fine — no duplication issues.
3. The problem arises when someone from the admin server uses the “Add to Server” option to invite the bot to their own server:
• The user ends up with duplicate global commands.
• Additionally, they also get the admin commands, which should not be available in their server.
It seems like the commands for the admin server are being improperly scoped or carried over during the re-invite process.
Here’s what my deploy script does:
• Cleans up global commands and admin guild-specific commands before deployment.
• Deploys global commands across all servers and admin commands only in the admin server.
Despite this, the issue persists when someone from the admin server invites the bot to a new server. How can I prevent global command duplication and restrict admin commands to the admin server in such scenarios?
Any guidance or best practices would be greatly appreciated!
please checkout the code here -> https://gist.github.com/Kiran-Alex/71d139ff426e19477d2969d2a9c11abd
33 replies
DIdiscord.js - Imagine ❄
•Created by Kbone22 on 1/17/2025 in #djs-questions
How to limit visibililty of Slash Commands
I have around 30 commands, and some of them are special commands that I want to be visible only in my support server. If someone adds the bot from my support server, these special commands should not be visible in their server. How can I achieve this?
6 replies
DIdiscord.js - Imagine ❄
•Created by Kbone22 on 1/15/2025 in #djs-questions
Global Commands are not registering
i made sure certain command is reserved for a particular server and remaining commands are global , the code which iam pasting below worked for the past 3 days but it stopped working yesterday - https://gist.github.com/Kiran-Alex/2920c666d0dadf5f309977b595fe3d03 and the output : - >
12 replies