Skip to content

Commit

Permalink
feat(moderation): disconnect from voice channel on mute (ReVanced#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 authored Dec 1, 2022
1 parent c2fe25a commit b2aa39b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/commands/moderation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit b2aa39b

Please sign in to comment.