diff --git a/bin/bot/src/discord/handler/brain/functions/moderation.rs b/bin/bot/src/discord/handler/brain/functions/moderation.rs index a0feb78..d58e7c9 100644 --- a/bin/bot/src/discord/handler/brain/functions/moderation.rs +++ b/bin/bot/src/discord/handler/brain/functions/moderation.rs @@ -1,5 +1,5 @@ use serde_json::json; -use serenity::prelude::Context; +use serenity::{model::Timestamp, prelude::Context}; use synixe_meta::discord::{channel::LOG, GUILD}; use time::{Duration, OffsetDateTime}; @@ -68,9 +68,11 @@ impl BrainFunction for Timeout { error!("failed to get member: {}", id); continue; }; - if member.communication_disabled_until.is_some() { - info!("user already timed out: {}", member.user.id); - continue; + if let Some(until) = member.communication_disabled_until { + if until > Timestamp::now() { + info!("user already timed out: {}", member.user.id); + continue; + } } info!("timing out user: {}", member.user.id); if let Err(e) = member