Updates things and adds debug options

This commit is contained in:
Karolis2011
2019-09-05 21:23:41 +03:00
parent e9f59780ed
commit 203811366b
2 changed files with 21 additions and 12 deletions

View File

@@ -49,12 +49,7 @@ namespace EventBot
private ServiceProvider ConfigureServices()
{
return new ServiceCollection()
.AddSingleton(s => new DiscordSocketClient(new DiscordSocketConfig() {
#if DEBUG
LogLevel = LogSeverity.Debug,
#endif
MessageCacheSize = 1500
}))
.AddSingleton(s => new DiscordSocketClient(getDiscordSocketConfig()))
.AddSingleton<CommandService>()
.AddSingleton<CommandHandlingService>()
.AddSingleton<EventManagementService>()
@@ -69,5 +64,19 @@ namespace EventBot
//.AddSingleton<PictureService>()
.BuildServiceProvider();
}
private DiscordSocketConfig getDiscordSocketConfig()
{
var config = new DiscordSocketConfig()
{
MessageCacheSize = 1500
};
#if DEBUG
config.LogLevel = LogSeverity.Debug;
#endif
if(Environment.GetEnvironmentVariable("DEBUG") != null)
config.LogLevel = LogSeverity.Debug;
return config;
}
}
}