From d0bedf904cfab7035c08d499575d7b878de2f018 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 16 Mar 2026 14:03:15 +0100 Subject: [PATCH 1/3] feat(command/moderation): adding the debug print to clear --- src/commands/moderation/clear.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/moderation/clear.rs b/src/commands/moderation/clear.rs index 1fadbfd..b9ce744 100644 --- a/src/commands/moderation/clear.rs +++ b/src/commands/moderation/clear.rs @@ -50,7 +50,7 @@ impl SlashCommand for Clear { _database: &PgPool, _emoji: &EmojiConfig, ) -> Result<()> { - debug!("Clear command called"); + debug!("{} command called", self.name()); let amount: u8 = command.data.options.iter().find(|opt | opt.kind() == CommandOptionType::Integer) .unwrap().value.as_i64().expect("REASON") as u8; let message: CreateInteractionResponseMessage = CreateInteractionResponseMessage::new() From e388ddfc8cceba1ff7e4c5ae8c42c6d85fe3d078 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 16 Mar 2026 14:03:39 +0100 Subject: [PATCH 2/3] feat(command/gestion): adding the debug print to set --- src/commands/gestion/set.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/commands/gestion/set.rs b/src/commands/gestion/set.rs index 34cebc7..13a8eea 100644 --- a/src/commands/gestion/set.rs +++ b/src/commands/gestion/set.rs @@ -20,13 +20,13 @@ async fn set_picture(slashcmd: &Set, ctx: &Context, cmd: &CommandInteraction, db _ => return Err(anyhow::anyhow!("Expected a subcommand")), }; - let url = inner_options - .iter() - .find(|opt| opt.name == "link") - .ok_or_else(|| anyhow::anyhow!("Option 'link' not found"))? - .value - .as_str() - .ok_or_else(|| anyhow::anyhow!("Option 'link' is not a string"))?; + let url: &str = inner_options + .iter() + .find(|opt| opt.name == "link") + .ok_or_else(|| anyhow::anyhow!("Option 'link' not found"))? + .value + .as_str() + .ok_or_else(|| anyhow::anyhow!("Option 'link' is not a string"))?; let attachment: CreateAttachment = CreateAttachment::url(&ctx.http, &url) .await?; @@ -85,7 +85,7 @@ impl SlashCommand for Set { _database: &PgPool, _emoji: &EmojiConfig, ) -> Result<()> { - debug!("Set command called"); + debug!("{} command called", self.name()); if !is_owner(_database, &command.user.id.to_string()).await? { let message: CreateInteractionResponseMessage = CreateInteractionResponseMessage::new() .content(format!("{} | This command is only for the owner", _emoji.answer.no)) From 3385bb36602deab8fa5981659f6830955219d41c Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 16 Mar 2026 14:03:54 +0100 Subject: [PATCH 3/3] feat(utils/format): adding the format_sanction module --- src/utils/format.rs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/utils/format.rs diff --git a/src/utils/format.rs b/src/utils/format.rs new file mode 100644 index 0000000..00ac718 --- /dev/null +++ b/src/utils/format.rs @@ -0,0 +1,6 @@ +pub fn format_sanction_reason(module_name:&str, reason: Option<&str>, executor: &str) -> String { + match reason { + Some(s) => format!("[TTY {}] {} by {}", module_name, s, executor), + None => format!("[TTY {}] by {}", module_name, executor) + } +}