From 0ca7ad4db056f71f0349291e86123f13a3cca6d5 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Fri, 28 May 2021 14:35:14 +0000 Subject: [PATCH] Minor fix to command logging. --- src/commands/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index acf00e1..33f9acf 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -132,14 +132,16 @@ fn log_command(cmd: &(impl Command + ?Sized), ctx: &Context, result: &ExecutionR use substring::Substring; let command = match cmd.is_secure() { true => cmd.name(), - false => ctx.message_body.substring(0, 30), + false => ctx.message_body, }; - let dots = match ctx.message_body.len() { + let dots = match command.len() { _len if _len > 30 => "[...]", _ => "", }; + let command = command.substring(0, 30); + match result { Ok(_) => { info!(