fix: remove handlers after failing to join call
This commit is contained in:
@@ -310,11 +310,8 @@ pub async fn handle(state: State, interaction: Interaction) {
|
||||
call.mute(true).await.expect("TODO");
|
||||
}
|
||||
|
||||
state
|
||||
.songbird
|
||||
.join(guild_id, voice_channel_id)
|
||||
.await
|
||||
.expect("TODO");
|
||||
match state.songbird.join(guild_id, voice_channel_id).await {
|
||||
Ok(_call) => {
|
||||
tracing::error!(?call, "successfully joined");
|
||||
|
||||
let channel_mention = format!("<#{voice_channel_id}>");
|
||||
@@ -347,4 +344,10 @@ pub async fn handle(state: State, interaction: Interaction) {
|
||||
]))
|
||||
.await
|
||||
.expect("TODO");
|
||||
},
|
||||
Err(join_error) => {
|
||||
tracing::error!(?join_error);
|
||||
let _ = state.songbird.remove(guild_id).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user