Esempio n. 1
0
 public ModixBot(
     DiscordSocketClient discordClient,
     ModixConfig modixConfig,
     CommandService commandService,
     DiscordSerilogAdapter serilogAdapter,
     IApplicationLifetime applicationLifetime,
     IServiceProvider serviceProvider,
     ILogger <ModixBot> logger)
 {
     _client              = discordClient ?? throw new ArgumentNullException(nameof(discordClient));
     _config              = modixConfig ?? throw new ArgumentNullException(nameof(modixConfig));
     _commands            = commandService ?? throw new ArgumentNullException(nameof(commandService));
     _provider            = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _serilogAdapter      = serilogAdapter ?? throw new ArgumentNullException(nameof(serilogAdapter));
     _applicationLifetime = applicationLifetime ?? throw new ArgumentNullException(nameof(applicationLifetime));
     Log = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Esempio n. 2
0
 public ModixBot(
     DiscordSocketClient discordClient,
     DiscordRestClient restClient,
     IOptions <ModixConfig> modixConfig,
     CommandService commandService,
     DiscordSerilogAdapter serilogAdapter,
     IApplicationLifetime applicationLifetime,
     IServiceProvider serviceProvider,
     ILogger <ModixBot> logger,
     IHostingEnvironment env)
 {
     _client              = discordClient ?? throw new ArgumentNullException(nameof(discordClient));
     _restClient          = restClient ?? throw new ArgumentNullException(nameof(restClient));
     _config              = modixConfig?.Value ?? throw new ArgumentNullException(nameof(modixConfig));
     _commands            = commandService ?? throw new ArgumentNullException(nameof(commandService));
     _provider            = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _serilogAdapter      = serilogAdapter ?? throw new ArgumentNullException(nameof(serilogAdapter));
     _applicationLifetime = applicationLifetime ?? throw new ArgumentNullException(nameof(applicationLifetime));
     Log  = logger ?? throw new ArgumentNullException(nameof(logger));
     _env = env;
 }