Table of Contents
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

config IConfiguration

IConfiguration provided via Dependency Injection. Aggregate method to access configuration files

logger ILogger<DiscordHostedService>

An ILogger to work with, provided via Dependency Injection

serviceProvider IServiceProvider

ServiceProvider reference which contains all items currently registered for Dependency Injection

applicationLifetime IHostApplicationLifetime

Contains the appropriate methods for disposing / stopping BackgroundServices during runtime

configBotSection string

The name of the JSON/Config Key which contains the configuration for this Discord Service