API reference
Constructor DiscordHostedService
- Namespace
- DisCatSharp.Hosting
- Assembly
- DisCatSharp.Hosting.dll
DiscordHostedService(IConfiguration, ILogger<DiscordHostedService>, IServiceProvider, IHostApplicationLifetime, string)
Initializes a new instance of the DiscordHostedService class.
protected DiscordHostedService(IConfiguration config, ILogger<DiscordHostedService> logger, IServiceProvider serviceProvider, IHostApplicationLifetime applicationLifetime, string configBotSection = "DisCatSharp")
Parameters
configIConfigurationIConfiguration provided via Dependency Injection. Aggregate method to access configuration files
loggerILogger<DiscordHostedService>An ILogger to work with, provided via Dependency Injection
serviceProviderIServiceProviderServiceProvider reference which contains all items currently registered for Dependency Injection
applicationLifetimeIHostApplicationLifetimeContains the appropriate methods for disposing / stopping BackgroundServices during runtime
configBotSectionstringThe name of the JSON/Config Key which contains the configuration for this Discord Service