2using System.Globalization;
4using Microsoft.Extensions.Logging;
5using Microsoft.Extensions.Options;
62 IOptions<GeneralConfiguration> generalConfigurationOptions,
63 IOptions<FileLoggingConfiguration> loggingConfigurationOptions)
69 generalConfiguration = generalConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(generalConfigurationOptions));
70 loggingConfiguration = loggingConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(loggingConfigurationOptions));
76 ArgumentNullException.ThrowIfNull(settings);
77 return settings.Provider
switch
86 ChatProvider.Discord =>
new DiscordProvider(
93 _ =>
throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture,
"Invalid ChatProvider: {0}", settings.Provider)),
IProvider for internet relay chat.
readonly FileLoggingConfiguration loggingConfiguration
The FileLoggingConfiguration for the ProviderFactory.
readonly IAsyncDelayer asyncDelayer
The IAsyncDelayer for the ProviderFactory.
IProvider CreateProvider(Models.ChatBot settings)
Create a IProvider.A new IProvider.
readonly GeneralConfiguration generalConfiguration
The GeneralConfiguration for the ProviderFactory.
readonly ILoggerFactory loggerFactory
The ILoggerFactory for the ProviderFactory.
readonly IJobManager jobManager
The IJobManager for the ProviderFactory.
ProviderFactory(IJobManager jobManager, IAssemblyInformationProvider assemblyInformationProvider, IAsyncDelayer asyncDelayer, ILoggerFactory loggerFactory, IOptions< GeneralConfiguration > generalConfigurationOptions, IOptions< FileLoggingConfiguration > loggingConfigurationOptions)
Initializes a new instance of the ProviderFactory class.
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the ProviderFactory.
File logging configuration options.
General configuration options.
For interacting with a chat service.
Manages the runtime of Jobs.
For waiting asynchronously.