only print logged commands if it was a valid command
This commit is contained in:
parent
9e3a72dcbc
commit
bb02fa6e90
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue