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
- 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[email protected]
v16.15.1
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
so what is
setDefaultMemberPermissions
used for ? and there isn't any way to restrict the use of a context menu command ?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 managersoh 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 ?
yes
ok thanks, well i'll work around that then