Exemple #1
0
 public OpenDndBot(
     DiscordSocketClient discordClient,
     DiscordRestClient restClient,
     IOptions <OpenDNDConfig> openDndConfig,
     CommandService commandService,
     DiscordSerilogAdapter serilogAdapter,
     IApplicationLifetime applicationLifetime,
     IServiceProvider serviceProvider,
     ILogger <OpenDndBot> logger,
     IHostingEnvironment env)
 {
     _discordClient       = discordClient ?? throw new ArgumentNullException(nameof(discordClient));
     _restClient          = restClient ?? throw new ArgumentNullException(nameof(restClient));
     _config              = openDndConfig?.Value ?? throw new ArgumentNullException(nameof(openDndConfig));
     _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;
 }
 public OpenDNDConfigValidator(IOptions <OpenDNDConfig> config)
 {
     _config = config.Value;
 }