How to manage channel and role permissions for context menu commands ?

Hello ! I'm sorry if that's quite a beginner question but I'm trying to set some channel and role permissions for a context menu command and i'm very confused by the documentation : I try to use the setDefaultMemberPermissions method from ContextMenuCommandBuilder which apparently needs a permissions bit field, but how do i set it to be used only in a specific channel or/and by a specific role ? Thanks in advance !
8 Replies
d.js toolkit
d.js toolkit15mo 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
Nenrikido
NenrikidoOP15mo ago
duck
duck15mo ago
channel/role/user permissions for application commands are not handled by server managers in the integrations tab of their server settings this can also be handled through oauth, but this should be considered as acting on behalf of the authorized user bot's themselves do not control this
Nenrikido
NenrikidoOP15mo ago
so what is setDefaultMemberPermissions used for ? and there isn't any way to restrict the use of a context menu command ?
duck
duck15mo ago
setDefaultMemberPermissions sets the default permissions required to use the command, e.g. ManageChannels as you've found, it takes a permission bitfield it only sets the default permissions required, and it can be overridden by server managers
Nenrikido
NenrikidoOP15mo ago
oh i see, so the max i can do is set it to "by default" not be used by people who don't have "manage messages" permissions for instance ?
duck
duck15mo ago
yes
Nenrikido
NenrikidoOP15mo ago
ok thanks, well i'll work around that then
Want results from more Discord servers?
Add your server