Driver: Fix multiple disconnect events on leave (#233)

Fixes behaviour where a Driver which was asked to leave an active call would receive the disconnect event several times: once when we started the disconnect, and once again when Discord killed the WS client.
This commit is contained in:
Kyle Simpson
2024-03-19 08:28:56 +00:00
committed by GitHub
parent 58f5c89f92
commit a5d9b58e94
2 changed files with 20 additions and 11 deletions

View File

@@ -75,6 +75,10 @@ pub enum DisconnectReason {
ProtocolViolation,
/// A voice connection was not established in the specified time.
TimedOut,
/// The call was manually disconnected by a user command, e.g. [`Driver::leave`].
///
/// [`Driver::leave`]: crate::driver::Driver::leave
Requested,
/// The Websocket connection was closed by Discord.
///
/// This typically indicates that the voice session has expired,