Slash commands : Default Permission to a role ?

I would like to know if it possible to restrict the view of the commands (not the usage) to a specific role ? Or we can only restrict using the default_member_permissions with discord permission (like view channel, for example) ? I wanted to "hide" the commands when something was not enabling in the settings of the bot (database settings), but I don't know if hiding commands is a good idea, as only admin can know a command is added and a lot of people don't know how to enable them (plus, only admin of a server can). It is a good idea to idea, or I should to global enable, and restrict the usage when doing the commands? (if loop) -# english is not my main language, sorry if I'm difficult to understand!
5 Replies
d.js toolkit
d.js toolkit2mo 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!
treble/luna
treble/luna2mo ago
In short, you as a dev, cant you can only set default member permissions server admins can limit this to a role the long answer is you can if you have an oauth2 token of a server admin, but djs does not support oauth2
Mara
MaraOP2mo ago
Okay, so it's better to "restrict" (aka send a message like "you can't do that !") the commands than hiding it?
treble/luna
treble/luna2mo ago
setting default member permissions will cause the command to not show to those who dont have permissions you can additionally add those checks but its the responsibility of the server admin if they decide to change those permissions
Mara
MaraOP2mo ago
Yeah, i know, but I don't know if it's a good idea. I have a serv where admin don't know how to that (enable/disable it) and I even with a tuto it's complicated T.T

Did you find this page helpful?