Class TelegramBotHostedService
Hosted service to start polling from Telegram API TelegramBotEvents receives updates
Inheritance
System.Object
Microsoft.Extensions.Hosting.BackgroundService
TelegramBotHostedService
Implements
Microsoft.Extensions.Hosting.IHostedService
System.IDisposable
Inherited Members
Microsoft.Extensions.Hosting.BackgroundService.ExecuteAsync(System.Threading.CancellationToken)
Microsoft.Extensions.Hosting.BackgroundService.StartAsync(System.Threading.CancellationToken)
Microsoft.Extensions.Hosting.BackgroundService.StopAsync(System.Threading.CancellationToken)
Microsoft.Extensions.Hosting.BackgroundService.Dispose()
Microsoft.Extensions.Hosting.BackgroundService.ExecuteTask
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.Services
Assembly: TelegramModularFramework.dll
Syntax
public class TelegramBotHostedService : BackgroundService, IHostedService, IDisposable
Constructors
| Improve this Doc View SourceTelegramBotHostedService(ITelegramBotClient, ILogger<TelegramBotHostedService>, TelegramBotEvents, TelegramBotUser, IOptions<TelegramBotHostConfiguration>)
Declaration
public TelegramBotHostedService(ITelegramBotClient botClient, ILogger<TelegramBotHostedService> logger, TelegramBotEvents events, TelegramBotUser telegramBotUser, IOptions<TelegramBotHostConfiguration> options)
Parameters
Type | Name | Description |
---|---|---|
Telegram.Bot.ITelegramBotClient | botClient | |
Microsoft.Extensions.Logging.ILogger<TelegramBotHostedService> | logger | |
TelegramBotEvents | events | |
TelegramBotUser | telegramBotUser | |
Microsoft.Extensions.Options.IOptions<TelegramBotHostConfiguration> | options |
Methods
| Improve this Doc View SourceExecuteAsync(CancellationToken)
Declaration
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | stoppingToken |
Returns
Type | Description |
---|---|
Task |
Implements
Microsoft.Extensions.Hosting.IHostedService
System.IDisposable