Class TelegramBotHostBuilderExtensions
Extends Microsoft.Extensions.Hosting.IHostBuilder with TelegramModularFramework configuration methods.
Inheritance
System.Object
TelegramBotHostBuilderExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: TelegramModularFramework
Assembly: TelegramModularFramework.dll
Syntax
public static class TelegramBotHostBuilderExtensions
Methods
| Improve this Doc View SourceAddTelegramBotHostBasics(IServiceCollection)
Not public API. Used by TelegramModularFramework.WebHook
Declaration
public static IServiceCollection AddTelegramBotHostBasics(this IServiceCollection services)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection |
AddTelegramModulesService(IHostBuilder, Nullable<Action<HostBuilderContext, TelegramModulesConfiguration>>)
Adds and configures a TelegramModulesService along with the required services and basics TypeReaders.
Declaration
public static IHostBuilder AddTelegramModulesService(this IHostBuilder builder, Action<HostBuilderContext, TelegramModulesConfiguration>? config = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Hosting.IHostBuilder | builder | The host builder to configure. |
System.Nullable<Action<Microsoft.Extensions.Hosting.HostBuilderContext, TelegramModulesConfiguration>> | config | The delegate to configure TelegramModulesConfiguration |
Returns
Type | Description |
---|---|
Microsoft.Extensions.Hosting.IHostBuilder | Host builder |
ConfigureTelegramBotHost(IHostBuilder, Action<HostBuilderContext, TelegramBotHostConfiguration>)
Adds and configures a Telegram.Bot.ITelegramBotClient along with the required services.
Declaration
public static IHostBuilder ConfigureTelegramBotHost(this IHostBuilder builder, Action<HostBuilderContext, TelegramBotHostConfiguration> config)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Hosting.IHostBuilder | builder | The host builder to configure. |
Action<Microsoft.Extensions.Hosting.HostBuilderContext, TelegramBotHostConfiguration> | config | The delegate to configure TelegramBotHostConfiguration |
Returns
Type | Description |
---|---|
Microsoft.Extensions.Hosting.IHostBuilder | Host builder |