From 815cb0df3b3e3f9dd2078b00f85754da87b1d55e Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 5 Dec 2023 05:17:49 -0500 Subject: refactor: centralize storage handlers --- src/commands/moderation/actions.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/commands/moderation/actions.rs') diff --git a/src/commands/moderation/actions.rs b/src/commands/moderation/actions.rs index 1050656..4d4d0f8 100644 --- a/src/commands/moderation/actions.rs +++ b/src/commands/moderation/actions.rs @@ -2,6 +2,7 @@ use crate::colors::Colors; use crate::Context; use color_eyre::eyre::{eyre, Result}; +use log::*; use poise::serenity_prelude::{CreateEmbed, User}; fn create_moderation_embed( @@ -23,7 +24,7 @@ fn create_moderation_embed( |e: &mut CreateEmbed| e.title(title).fields(fields).color(Colors::Red) } -// ban a user +/// ban a user #[poise::command( slash_command, prefix_command, @@ -42,6 +43,7 @@ pub async fn ban_user( let reason = reason.unwrap_or("n/a".to_string()); + debug!("Banning user {} with reason {reason}", user.id); if reason != "n/a" { guild.ban_with_reason(ctx, &user, days, &reason).await?; } else { @@ -55,7 +57,7 @@ pub async fn ban_user( Ok(()) } -// kick a user +/// kick a user #[poise::command( slash_command, prefix_command, @@ -68,6 +70,7 @@ pub async fn kick_user(ctx: Context<'_>, user: User, reason: Option) -> let reason = reason.unwrap_or("n/a".to_string()); + debug!("Kicking user {} for reason {reason}", user.id); if reason != "n/a" { guild.kick_with_reason(ctx, &user, &reason).await?; } else { -- cgit v1.2.3