From 82e94334c9f622aa2553b1e7edcdd3e6b6dc239c Mon Sep 17 00:00:00 2001 From: TheUbMunster <66451362+TheUbMunster@users.noreply.github.com> Date: Mon, 22 Aug 2022 16:43:00 -0600 Subject: [PATCH] added log message that prints the channel the command came from and the channel commands are accepted from --- Server/DiscordBot.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/DiscordBot.cs b/Server/DiscordBot.cs index 90f2428..c1fb2e4 100644 --- a/Server/DiscordBot.cs +++ b/Server/DiscordBot.cs @@ -96,6 +96,7 @@ public class DiscordBot { Reconnecting = false; string mentionPrefix = $"{DiscordClient.CurrentUser.Mention} "; DiscordClient.MessageCreated += async (_, args) => { + Logger.Info($"Message recieved on channel \"{args.Channel.Id}\", accepting commands from channel \"{Config.LogChannel ?? "(Any Channel)"}\", do channels match: {args.Channel.Id.ToString() == Config.LogChannel}"); if (args.Author.IsCurrent) return; //dont respond to commands from ourselves (prevent "sql-injection" esq attacks) //prevent commands via dm and non-public channels if (Config.LogChannel == null) { @@ -105,7 +106,7 @@ public class DiscordBot { } if (args.Channel is DiscordDmChannel) { #if LOG_BAD_REQ - Logger.Warn("A command was sent to the bot in a non-public channel. This will not be processed. (Send commands in the specified LogChannel in settings.json or only in public channels)"); + Logger.Warn("A command was sent to the bot in a direct message channel. This will not be processed. (Send commands in the specified LogChannel in settings.json or only in public channels)"); #endif #if SEND_RESP_TO_BAD_REQ await args.Message.RespondAsync("This channel is not valid for running commands. (Your command was not processed).");