diff --git a/src/commands/moderation.rs b/src/commands/moderation.rs index 9d62e05..a646310 100644 --- a/src/commands/moderation.rs +++ b/src/commands/moderation.rs @@ -10,7 +10,7 @@ use poise::serenity_prelude::{ User, }; use tracing::log::error; -use tracing::{debug, trace}; +use tracing::{debug, warn, trace}; use crate::db::model::{LockedChannel, Muted}; use crate::utils::moderation::{ @@ -313,6 +313,12 @@ pub async fn mute( ), ); + if result.is_none() { + if let Err(e) = member.disconnect_from_voice(&ctx.discord().http).await { + warn!("Could not disconnect member from voice channel: {}", e); + } + } + respond_moderation( &ctx, &ModerationKind::Mute(