0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-21 18:55:17 +00:00

changed isPrivate check to type check of "is DiscordDmChannel"

This commit is contained in:
TheUbMunster 2022-08-22 16:35:06 -06:00 committed by Sanae
parent d828a704c1
commit b6e634ada4

View file

@ -1,5 +1,5 @@
#define SEND_RESP_TO_BAD_REQ #define SEND_RESP_TO_BAD_REQ //should the bot send a message to people who attempt to run a command from an invalid location? (Comment out to disable)
#define LOG_BAD_REQ #define LOG_BAD_REQ //should the bot log aformentioned invalid requests?
using DSharpPlus; using DSharpPlus;
using DSharpPlus.Entities; using DSharpPlus.Entities;
@ -103,7 +103,7 @@ public class DiscordBot {
Logger.Warn("You probably should set your LogChannel in settings.json"); Logger.Warn("You probably should set your LogChannel in settings.json");
warnedAboutNullLogChannel = true; warnedAboutNullLogChannel = true;
} }
if (args.Channel.IsPrivate) { if (args.Channel is DiscordDmChannel) {
#if LOG_BAD_REQ #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 non-public channel. This will not be processed. (Send commands in the specified LogChannel in settings.json or only in public channels)");
#endif #endif