-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Slash Commands Permissions #2737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
this is so handy, thanks for pushing this out! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick but consistency
Co-authored-by: Vlad Frangu <[email protected]>
There probably should be a way to PUT/DELETE single entries in these whitelists similar to how permission overwrites and role add/remove work. Seems like right now you can only replace the entire list. |
Do you plan to change this soon or is it postponed? I imagine the picker flooded with commands that I can't even use and this makes me disappointed. |
It's a difficult problem. I can't promise it'll be soon, but it is top of mind. In a pathologically bad case of a bot having 100 slash commands and they are all disabled, our clients would have to do multiple requests before we had a full list of commands to show a user (and the user would think Discord/your bot is being super slow). Next steps are to scope possible solutions. |
does admin/owner override slash command per-command permissions? or does the app really have full control over who gets to use what |
Co-authored-by: Jan <[email protected]> Co-authored-by: Tiemen <[email protected]> Co-authored-by: Zomatree <[email protected]> Co-authored-by: SpaceEEC <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I just had a few possible changes in mind.
Does the I set permissions for the everyone role in a guild for a command with {
"application_commands":[
{
"application_id":"764995504526327848",
"default_permission":false,
"description":"Lock all channels in the server, useful for stopping raids",
"id":"822814700604882945",
"name":"lockdown",
"options":[...],
"permissions":[
{
"id":"692925064135311390",
"permission":true,
"type":1
}
],
"version":"824757314275901495"
}
],
"guild_id":"692925064135311390",
"nonce":"29",
"updated_at":"1616708947925"
} |
Setting Also, it seems like many bots will end up with a /config or similar to set up moderator roles and / or users (maybe buttons when those are a thing). Is there a plan for a system to allow those with Finally, I was under the impression that we might get the ability to disable specific slash commands in specific channels, is that still planned or just not happening? |
Oh, all the create / edit endpoints also didn't document the additional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON bodies for the POST and PATCH command endpoints (both guild and global) are missing the default_permission
param from them:
| default_permission? | boolean (default `true`) | whether the command is enabled by default when the app is added to a guild |
Additionally, the command permissions endpoints return an object or array of objects, so a new object should be documented for them:
id: snowflake
application_id: snowflake
guild_id: snowflake
permissions: array of ApplicationCommandPermissions
The bulk permission update endpoint (PUT https://discord.com/api/v8/applications/{application.id}/guilds/{guild.id}/commands/permissions) isn't documented in this PR |
A few bugs / issues / discrepancies with the new slash command update + permissions that me and others have encountered today:
|
Also in addition a description of the permission should be added so whenever a user is blocked from using a command they will actually have an idea why, because otherwise they will likely be confused and not understand what is going on. |
Is it just for me but when the command doesn't have any permissions set it errors 404? |
It is not only for you. Try checking whether you get error code I need to admit, an empty payload for this case would be more intuitive. |
yeah it's |
@rxdn this is tracked internally now |
This code is actually already live in production, so feel free to play around with it. Documentation is WIP not because we're not done building it, just because it might not be 100% correct yet 😄