Updates things and adds debug options
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user