fix deafen on join
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-02-16 18:52:02 +01:00
parent 0c1fc06adf
commit ab7e9b47f6

View File

@@ -17,12 +17,6 @@ pub(crate) async fn join(
let channel_id =
NonZeroU64::new(channel_id.into()).ok_or("Joined voice channel must have nonzero ID.")?;
// signal that we are not listening
if let Some(call_lock) = state.songbird.get(guild_id) {
let mut call = call_lock.lock().await;
call.deafen(true).await?;
}
// join the voice channel
state
.songbird
@@ -30,5 +24,11 @@ pub(crate) async fn join(
.await
.map_err(|e| format!("Could not join voice channel: {:?}", e))?;
// signal that we are not listening
if let Some(call_lock) = state.songbird.get(guild_id) {
let mut call = call_lock.lock().await;
call.deafen(true).await?;
}
Ok(())
}