/// <summary> /// Constructs the <see cref="StartupService"/> /// </summary> public StartupService(DiscordBotServiceContainer services, IConfigurationRoot config, DiscordSocketClient client, CommandServiceEx commands, IDiscordBot discordBot) { Services = services; Client = client; Commands = commands; DiscordBot = discordBot; }
/// <summary> /// Constructs the <see cref="DefaultLoggingService"/>. /// </summary> //public LoggingService(DiscordBotServiceContainer services) : base(services) { public DefaultLoggingService(DiscordSocketClient client, CommandServiceEx commands, IConfigurationRoot config) { AppDomain.CurrentDomain.UnhandledException += AppDomain_UnhandledException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; client.Log += OnLogAsync; commands.Log += OnLogAsync; bool.TryParse(config["log:debug"], out logDebug); bool.TryParse(config["log:trace"], out logTrace); bool.TryParse(config["log:print"], out logPrint); bool.TryParse(config["log:notice"], out logNotice); }