Changed LogLevel to Verbose.

This commit is contained in:
Brett Hewitson 2021-12-16 21:46:31 +10:00
parent b31052e25b
commit e2e95da737
3 changed files with 12 additions and 12 deletions

View file

@ -62,11 +62,11 @@ namespace ServerManagerTool.DiscordBot
var socketConfig = new DiscordSocketConfig var socketConfig = new DiscordSocketConfig
{ {
#if DEBUG //#if DEBUG
LogLevel = LogSeverity.Verbose, LogLevel = LogSeverity.Verbose,
#else //#else
LogLevel = LogSeverity.Info, // LogLevel = LogSeverity.Info,
#endif //#endif
// Tell Discord.Net to cache 1000 messages per channel // Tell Discord.Net to cache 1000 messages per channel
MessageCacheSize = 1000, MessageCacheSize = 1000,
}; };
@ -80,11 +80,11 @@ namespace ServerManagerTool.DiscordBot
{ {
// Force all commands to run async // Force all commands to run async
DefaultRunMode = RunMode.Async, DefaultRunMode = RunMode.Async,
#if DEBUG //#if DEBUG
LogLevel = LogSeverity.Verbose, LogLevel = LogSeverity.Verbose,
#else //#else
LogLevel = LogSeverity.Info, // LogLevel = LogSeverity.Info,
#endif //#endif
}; };
var discordBotWhitelistConfig = new DiscordBotWhitelistConfig var discordBotWhitelistConfig = new DiscordBotWhitelistConfig

View file

@ -51,13 +51,13 @@ namespace ServerManagerTool.DiscordBot.Services
} }
} }
// Create the command context
var context = new SocketCommandContext(_discord, msg);
// Check if the message has a valid command prefix // Check if the message has a valid command prefix
var argPos = 0; var argPos = 0;
if (msg.HasStringPrefix(_config["DiscordSettings:Prefix"], ref argPos) || msg.HasMentionPrefix(_discord.CurrentUser, ref argPos)) if (msg.HasStringPrefix(_config["DiscordSettings:Prefix"], ref argPos) || msg.HasMentionPrefix(_discord.CurrentUser, ref argPos))
{ {
// Create the command context
var context = new SocketCommandContext(_discord, msg);
// Execute the command // Execute the command
var result = await _commands.ExecuteAsync(context, argPos, _provider); var result = await _commands.ExecuteAsync(context, argPos, _provider);

View file

@ -31,7 +31,7 @@ namespace ServerManagerTool.DiscordBot.Services
_commands.Log += OnLogAsync; _commands.Log += OnLogAsync;
} }
private async Task OnLogAsync(LogMessage message) internal async Task OnLogAsync(LogMessage message)
{ {
// Create the log directory if it doesn't exist // Create the log directory if it doesn't exist
if (!Directory.Exists(LogDirectory)) if (!Directory.Exists(LogDirectory))