From bb02fa6e90d3b46be3d64a114c96e1c20e25df46 Mon Sep 17 00:00:00 2001 From: TheUbMunster Date: Sat, 24 Dec 2022 01:04:23 -0700 Subject: [PATCH] only print logged commands if it was a valid command --- Server/DiscordBot.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Server/DiscordBot.cs b/Server/DiscordBot.cs index c5294c5..de54e30 100644 --- a/Server/DiscordBot.cs +++ b/Server/DiscordBot.cs @@ -147,10 +147,6 @@ public class DiscordBot if ((arg.Channel.Id.ToString() == localSettings.CommandChannel || arg.Channel.Id.ToString() == localSettings.LogChannel) && !arg.Author.IsBot) { string message = (await arg.Channel.GetMessageAsync(arg.Id)).Content; - if (localSettings.LogCommands) - { - logger.Info($"\"{arg.Author.Username}\" ran the command: \"{message}\" via discord"); - } //run command try { @@ -172,6 +168,10 @@ public class DiscordBot } if (resp != null) { + if (localSettings.LogCommands) + { + logger.Info($"\"{arg.Author.Username}\" ran the command: \"{message}\" via discord"); + } foreach (string mesg in SplitMessage(resp)) await (arg as SocketUserMessage).ReplyAsync(mesg); }