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

Rate limit is per connection not shard #5844

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

MinnDevelopment
Copy link
Contributor

No description provided.

@appellation appellation changed the title Rate limit is per session not shard Rate limit is per connection not shard Jan 11, 2023
@appellation appellation merged commit 904e52d into discord:main Jan 11, 2023
@MinnDevelopment MinnDevelopment deleted the patch-gw-limits branch January 11, 2023 20:53
@switchupcb
Copy link
Contributor

switchupcb commented Jan 31, 2023

@MinnDevelopment @appellation Request to revisit wording as a connection is used as an equivalent to a session. However, a session provides a better representation of the actual rate limit? See the following message for a choice that clarifies the current ambiguity.

@switchupcb
Copy link
Contributor

Per connection implies that the rate limit resets upon a disconnect. It could refer to the initial connection or a session. It's ambiguous because "connection" is currently defined as process in the documentation; not a resource.

Per session implies that a bot application will be limited to 120 RPS per session. For example, an bot application (token) with a session start limit >1 could maintain three different sessions which implies the management of three 120 RPS rate limits.

Per shard — as per b7a7617 (@ssMMiles) — implies that there is a 120 RPS rate limit per shard. For example, there could be a 120 RPS for an application's DM data [Shard 0] vs. an application's Guild Data [Shard 1]. This doesn't make sense because you send a command via WebSocket Session and not via shard (of the session).

Per application implies that a bot application (defined by token) must adhere to the 120 RPS limit regardless of the amount of sessions that are connected. This definition was used before the documentation was updated.

@switchupcb
Copy link
Contributor

#5898

shaydewael pushed a commit to Jupith/discord-api-docs that referenced this pull request May 14, 2024
* Rate limit is per session not shard

* Per connection
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.

3 participants