diff --git a/src/main.rs b/src/main.rs index 09f8030..0a155bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -337,11 +337,14 @@ async fn handle_events(command_router: Arc, state: State, mut sha .await { match event_res { + Ok(twilight_model::gateway::event::Event::GatewayClose(frame_option)) => { + tracing::warn!(?frame_option); + return; + } Ok(event) => { handle_event(command_router.clone(), state.clone(), event).await; } - Err(twilight_model::gateway::event::Event::GatewayClose(frame_option)) => { - tracing::warn!(?frame_option); + Err(reconnect_error) if reconnect_error.kind() == twilight_gateway::error::ReceiveMessageErrorType::Reconnect => { return; } Err(error) => {