Skip to content
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

Update slash command limits #2667

Merged
merged 4 commits into from
Mar 3, 2021
Merged

Update slash command limits #2667

merged 4 commits into from
Mar 3, 2021

Conversation

typpo
Copy link
Contributor

@typpo typpo commented Mar 2, 2021

No description provided.

@typpo typpo requested a review from msciotti March 2, 2021 22:52
@typpo typpo changed the title Update slash command rate limits Update slash command limits Mar 2, 2021
- An app can have up to 25 subcommands within a subcommand group
- commands can have up to 25 `options`
- options can have up to 25 `choices`
- Maximum of 4000 characters for combined name, description, and value properties for each command and its children
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I am encouraged to try having a shorter description for each option?

Additionally, what does "for each command and its children" mean? What is an example of a command invocation that wouldn't work?

docs/interactions/Slash_Commands.md Outdated Show resolved Hide resolved
- Limitations on [command names](#DOCS_INTERACTIONS_SLASH_COMMANDS/registering-a-command)
- Limitations on [nesting subcommands and groups](#DOCS_INTERACTIONS_SLASH_COMMANDS/nested-subcommands-and-groups)
- Rate limitation of 2 requests per 60 seconds for batch update
- Rate limitation of 5 requests per 20 seconds for all other routes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Rate limitation of 5 requests per 20 seconds for all other routes
- Rate limit of 5 requests per 20 seconds for all other routes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only create, edit and delete routes have this limit, get, get-all ones are unlimited.

docs/interactions/Slash_Commands.md Outdated Show resolved Hide resolved
- Limitations on [command names](#DOCS_INTERACTIONS_SLASH_COMMANDS/registering-a-command)
- Limitations on [nesting subcommands and groups](#DOCS_INTERACTIONS_SLASH_COMMANDS/nested-subcommands-and-groups)
- Rate limitation of 2 requests per 60 seconds for batch update
Copy link
Contributor

@A5rocks A5rocks Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the batch update for guilds keyed by guild ID? (Yes I know guild ID is a major parameter in this route, I just have to make sure though :')

Suggested change
- Rate limitation of 2 requests per 60 seconds for batch update
- Rate limit of 2 requests per 60 seconds for batch update

@RedDaedalus
Copy link
Member

Is there a reason rate limits are documented for slash commands specifically but nowhere else in the docs?

@msciotti
Copy link
Contributor

msciotti commented Mar 2, 2021

Is there a reason rate limits are documented for slash commands specifically but nowhere else in the docs?

@RedDaedalus just an oversight on our part. We'll be taking them out in line with the rest of the docs since they're returned in headers. Be nice to Ian he's new ;)

typpo and others added 3 commits March 3, 2021 10:10
Co-authored-by: EXPLOSION <git@helvetica.moe>
Co-authored-by: EXPLOSION <git@helvetica.moe>
@typpo typpo merged commit 2474dc2 into master Mar 3, 2021
@typpo typpo deleted the typpo-patch-1 branch March 3, 2021 18:14
Nihlus added a commit to Remora/Remora.Discord that referenced this pull request Mar 6, 2021
Nihlus added a commit to Remora/Remora.Discord that referenced this pull request Mar 6, 2021
HuyaneMatsu added a commit to HuyaneMatsu/hata that referenced this pull request Mar 10, 2021
References:

discord/discord-api-docs#2667

- Update application command limits.
- Add length assertion for `ApplicationCommandOptionChoice.value`.
- Add `ApplicationCommandOptionChoice.__len__`.
- Add `ApplicationCommandOption.__len__`.
- Add `ApplicationCommand.__len__`.

discord/discord-api-docs#2615

- Add `InteractionType`.
- Add `InteractionEvent.type`.
- Add `Message.interaction`.
- Add `file` parameter to `Client.webhook_message_edit`.
- Add `file` parameter to `Client.interaction_response_message_edit`.
- Add `file` parameter to `Client.interaction_followup_message_edit`.

discord/discord-api-docs#2690

- Add `InviteTargetType.EMBEDDED_APPLICATION`.
- Add `Invite.target_application`.
- Add `target_application` parameter to `Invite.precreate`.
- Add `Client.application_invite_create`.

discord/discord-api-docs#2692

- Add `ChannelVoice.region` attribute.
- Add `region` parameter to `ChannelVoice.precreate`.
- Add `region` parameter to `cr_pg_channel_object`. (Inherited by `Client.channel_create`.)
- Add `region` parameter to `Client.channel_edit`.
- Handle voice client disconnect when moving between voice channels of different regions.

Public API:

Coroutine generators yielded or returned from slash commands are handled as coroutine generator slash commands themselves.
Add `SlashResponse` class.
Update `slash.md`.
Add `'number'` annotation to slash commands.
Add `emoji.md` to topics.
Add `Application.precreate`.

Internal:

Fix a broken docstring in `Color` (Reported by NeKun#9509).
Add `URL.subdomain`.
Add `URL.raw_subdomain`.
Slash commands dropped back type based annotations.
Redo slash command syncing to handle extensions correctly.
`Application.__new__` could not set `.flags`.
Update links in intro.
Fix formatting issues in commands extension.
`Extension._unload_extension` did not use executor when rendering exception traceback.
Missing `ApplicationCommand.__ne__` caused errors (inheritance issues probably).
Update `Guild.precreate.__doc__`.
Remove unused `Guild.has_animated_icon` attribute (was removed like 1 year ago, lol).
Add `region` parameter to `Guild.precreate`.
Handle voice client player and reader stop when the guild's voice region changes.
Do voice client reconnect for close code `1006`.
`User.has_higher_role_than_at` could return `False` when the other other is not in the guild meanwhile self is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants