-
Notifications
You must be signed in to change notification settings - Fork 1.3k
User and Message Application Commands #3614
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
> info | ||
> If your application only talks to Discord through creating Slash Commands and responding to Interactions, and does not use any other part of our API, **you no longer need to request the bot scope**. | ||
|
||
Who knows, maybe in the future, Interactions tokens will become even smarter. |
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.
Was this idea scrapped? Or is it still on the table?
Because at the moment, interactions-only bots are severely underpowered (well, somewhat. They're good for just a request-reply command, but they miss some critical context that is needed otherwise).
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.
It's not scrapped, no. This just felt a little sales-pitch-y from when slash commands were new, and I figured with more need to know stuff in the docs, it was OK to remove some fluff.
| id | snowflake | the [`ID`](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/application-command-object-application-command-structure) of the invoked command | Slash Command | | ||
| name | string | the [`name`](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/application-command-object-application-command-structure) of the invoked command | Slash Command | | ||
| resolved? | [resolved data](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-object-resolved-data-structure) | converted users + roles + channels | Slash Command | |
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.
These apply to all Application Commands right?
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.
Yes, thanks!
|
||
Global commands are available on _all_ your app's guilds. Global commands are cached for **1 hour**. That means that new global commands will fan out slowly across all guilds, and will be guaranteed to be updated in an hour. | ||
|
||
Global commands have inherent read-repair functionality. That means that if you make an update to a global command, and a user tries to use that command before it has updated for them, Discord will do an internal version check and reject the command, and trigger a faster reload for the guild in which it was used. |
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.
Any details on how much "faster" this "faster reload" is?
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.
Let me find out exactly.
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.
It'll get refreshed next time a client queries for commands, but there's a rate limit on it, so it's possible that a user could have a command rejected a couple times until a rate limit is lifted.
That's all behind the scenes semantics though. The TLDR is that if you update a command, you can be sure that you will receive interactions payloads that reflect the updated command.
"id": MODERATOR_ROLE_ID, | ||
"type": 1, | ||
"permission": True | ||
###### Example Interaction |
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 way to differentiate between slash cmds and context menu cmds is by keeping track of the command id?
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.
Or their type.
1
: Slash command
2
: User command
3
: Message command
need to add type to the creation endpoints |
Co-authored-by: ckohen <chaikohen@gmail.com>
Co-authored-by: monbrey <rsm999@uowmail.edu.au>
Co-authored-by: Advaith <advaithj1@gmail.com>
e33a089
to
b04a500
Compare
This commit adds support to user and message context menus, which can be created with a new type of application command. Refer to discord/discord-api-docs#3614.
Why was this very useful section removed? You can only get this full info from third party sites now |
(Someone in the serenity support server asked about subcommand limits and I remembered the above section but couldn't find it in the docs, so I searched around for like 20min to find that this PR yeeted the section) |
This is a pretty hefty docs overhaul to support new types of application commands:
USER
andMESSAGE
.TLDR: New context menu commands on users and messages are types of application commands. I've renamed the "Slash Commands" section to "Application Commands" and refactored the documentation section into:
Shoutouts to @ckohen for doing the work in splitting out interactions data from slash commands to begin with. Made this significantly easier ❤️
TODO: