mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-04-30 06:24:27 +02:00
feat(moderation): disconnect from voice channel on mute (#39)
This commit is contained in:
parent
c2fe25a3a8
commit
b2aa39b9b6
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user