-
Notifications
You must be signed in to change notification settings - Fork 1.3k
More voice disconnect reasons #7582
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
base: main
Are you sure you want to change the base?
Conversation
@@ -88,10 +88,13 @@ Our voice gateways have their own set of opcodes and close codes. | |||
| 4009 | Session timeout | Your session has timed out. | | |||
| 4011 | Server not found | We can't find the server you're trying to connect to. | | |||
| 4012 | Unknown protocol | We didn't recognize the [protocol](/docs/topics/voice-connections#establishing-a-voice-udp-connection-example-select-protocol-payload) you sent. | | |||
| 4014 | Disconnected | Channel was deleted, you were kicked, voice server changed, or the main gateway session was dropped. Should not reconnect. | | |||
| 4014 | Disconnected | Disconnect indiviual client (you were kicked, the main gateway session was dropped, etc.). Should not reconnect. | |
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.
| 4014 | Disconnected | Disconnect indiviual client (you were kicked, the main gateway session was dropped, etc.). Should not reconnect. | | |
| 4014 | Disconnected | Disconnect individual client (you were kicked, the main gateway session was dropped, etc.). Should not reconnect. | |
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.
Fixed!
Can the "description" values be made unique? that field is used as the opcode name in enums |
| 4015 | Voice server crashed | The server crashed. Our bad! Try [resuming](/docs/topics/voice-connections#resuming-voice-connection). | | ||
| 4016 | Unknown encryption mode | We didn't recognize your [encryption](/docs/topics/voice-connections#transport-encryption-and-sending-voice). | | ||
| 4020 | Bad request | You sent a malformed request | | ||
| 4021 | Disconnected | Disconnect due to rate limit exceeded. Should not reconnect. | | ||
| 4022 | Disconnected | Disconnect all clients (channel deleted, voice server changed, etc.). Should not reconnect. | |
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.
Why does this get sent when the user was the last connected one (see #7575)? Is that an oversight? Why does changing the voice server imply you shouldn't reconnect? That seems strange to me.
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 we observe this close code implies 3 different scenarios (might be more idk what else is hidden behind "etc." here).
- Bot is kicked and channel is now empty -> no reconnect
- Channel is deleted -> no reconnect
- Voice server changed -> connect to new voice server (essentially reconnect with extra steps)
This means the client has to decide based on context information how to handle this closure. Which makes implementation unnecessarily difficult. I would expect all these scenarios to use different close codes.
- Should be 4014 as usual for voice kicks
- Can be 4022 (Channel deleted / User removed from guild / Channel no longer accessible / etc.)
- Should be a different code like 4023 (voice server changed), which can be handled differently.
Unless I'm completely misreading these docs, which means they can be improved.
| 4015 | Voice server crashed | The server crashed. Our bad! Try [resuming](/docs/topics/voice-connections#resuming-voice-connection). | | ||
| 4016 | Unknown encryption mode | We didn't recognize your [encryption](/docs/topics/voice-connections#transport-encryption-and-sending-voice). | | ||
| 4020 | Bad request | You sent a malformed request | | ||
| 4021 | Disconnected | Disconnect due to rate limit exceeded. Should not reconnect. | |
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.
Disconnect due to rate limit exceeded
There are no mentions of rate limits in the voice docs.
Can we get more information on this?
No description provided.