Skip to content

Commit 6d90ebd

Browse files
authored
Clarify if sessions are resumable for each gateway close
1 parent ab64846 commit 6d90ebd

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

docs/topics/Opcodes_and_Status_Codes.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@ All gateway events in Discord are tagged with an opcode that denotes the payload
2323

2424
###### Gateway Close Event Codes
2525

26-
In order to prevent broken reconnect loops, you should consider some close codes as a signal to stop reconnecting. This can be because your token expired, or your identification is invalid. This table explains what the application defined close codes for the gateway are, and which close codes you should not attempt to reconnect.
26+
In order to prevent broken reconnect loops, you should consider some close codes as a signal to stop reconnecting. This can be because your token expired, or your identification is invalid. This table explains what the application-defined close codes for the gateway are, and what actions you are expected to do when receiving them.
2727

2828

29-
| Code | Description | Explanation | Reconnect |
30-
|------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
31-
| 4000 | Unknown error | We're not sure what went wrong. Try reconnecting? | true |
32-
| 4001 | Unknown opcode | You sent an invalid [Gateway opcode](#DOCS_TOPICS_OPCODES_AND_STATUS_CODES/gateway-gateway-opcodes) or an invalid payload for an opcode. Don't do that! | true |
33-
| 4002 | Decode error | You sent an invalid [payload](#DOCS_TOPICS_GATEWAY/sending-events) to Discord. Don't do that! | true |
34-
| 4003 | Not authenticated | You sent us a payload prior to [identifying](#DOCS_TOPICS_GATEWAY/identifying), or this session has been invalidated. | true |
35-
| 4004 | Authentication failed | The account token sent with your [identify payload](#DOCS_TOPICS_GATEWAY_EVENTS/identify) is incorrect. | false |
36-
| 4005 | Already authenticated | You sent more than one identify payload. Don't do that! | true |
37-
| 4007 | Invalid `seq` | The sequence sent when [resuming](#DOCS_TOPICS_GATEWAY_EVENTS/resume) the session was invalid. Reconnect and start a new session. | true |
38-
| 4008 | Rate limited | Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this. | true |
39-
| 4009 | Session timed out | Your session timed out. Reconnect and start a new one. | true |
40-
| 4010 | Invalid shard | You sent us an invalid [shard when identifying](#DOCS_TOPICS_GATEWAY/sharding). | false |
41-
| 4011 | Sharding required | The session would have handled too many guilds - you are required to [shard](#DOCS_TOPICS_GATEWAY/sharding) your connection in order to connect. | false |
42-
| 4012 | Invalid API version | You sent an invalid version for the gateway. | false |
43-
| 4013 | Invalid intent(s) | You sent an invalid intent for a [Gateway Intent](#DOCS_TOPICS_GATEWAY/gateway-intents). You may have incorrectly calculated the bitwise value. | false |
44-
| 4014 | Disallowed intent(s) | You sent a disallowed intent for a [Gateway Intent](#DOCS_TOPICS_GATEWAY/gateway-intents). You may have tried to specify an intent that you [have not enabled or are not approved for](#DOCS_TOPICS_GATEWAY/privileged-intents). | false |
29+
| Code | Description | Explanation | Action |
30+
|------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
31+
| 4000 | Unknown error | We're not sure what went wrong. Try reconnecting? | Reconnect & resume session |
32+
| 4001 | Unknown opcode | You sent an invalid [Gateway opcode](#DOCS_TOPICS_OPCODES_AND_STATUS_CODES/gateway-gateway-opcodes) or an invalid payload for an opcode. Don't do that! | Reconnect & start a new session |
33+
| 4002 | Decode error | You sent an invalid [payload](#DOCS_TOPICS_GATEWAY/sending-events) to Discord. Don't do that! | Reconnect & resume session |
34+
| 4003 | Not authenticated | You sent us a payload prior to [identifying](#DOCS_TOPICS_GATEWAY/identifying), or this session has been invalidated. | Reconnect & start a new session |
35+
| 4004 | Authentication failed | The account token sent with your [identify payload](#DOCS_TOPICS_GATEWAY_EVENTS/identify) is incorrect. | Don't reconnect automatically! |
36+
| 4005 | Already authenticated | You sent more than one identify payload. Don't do that! | Reconnect & start a new session |
37+
| 4007 | Invalid `seq` | The sequence sent when [resuming](#DOCS_TOPICS_GATEWAY_EVENTS/resume) the session was invalid. | Reconnect & start a new session |
38+
| 4008 | Rate limited | Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this. | Reconnect & resume session |
39+
| 4009 | Session timed out | Your session timed out. | Reconnect & start a new session |
40+
| 4010 | Invalid shard | You sent us an invalid [shard when identifying](#DOCS_TOPICS_GATEWAY/sharding). | Don't reconnect automatically! |
41+
| 4011 | Sharding required | The session would have handled too many guilds - you are required to [shard](#DOCS_TOPICS_GATEWAY/sharding) your connection in order to connect. | Don't reconnect automatically! |
42+
| 4012 | Invalid API version | You sent an invalid version for the gateway. | Don't reconnect automatically! |
43+
| 4013 | Invalid intent(s) | You sent an invalid intent for a [Gateway Intent](#DOCS_TOPICS_GATEWAY/gateway-intents). You may have incorrectly calculated the bitwise value. | Don't reconnect automatically! |
44+
| 4014 | Disallowed intent(s) | You sent a disallowed intent for a [Gateway Intent](#DOCS_TOPICS_GATEWAY/gateway-intents). You may have tried to specify an intent that you [have not enabled or are not approved for](#DOCS_TOPICS_GATEWAY/privileged-intents). | Don't reconnect automatically! |
4545

4646
## Voice
4747

0 commit comments

Comments
 (0)