* Fixed HostedUpdateWebhooker startup logic
This commit is contained in:
@@ -44,19 +44,22 @@ namespace Telegrator.Hosting.Web.Polling
|
|||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public Task StartAsync(CancellationToken cancellationToken)
|
public Task StartAsync(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
StartInternal(cancellationToken);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void StartInternal(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
string pattern = new UriBuilder(_options.WebhookUri).Path;
|
string pattern = new UriBuilder(_options.WebhookUri).Path;
|
||||||
_botHost.MapPost(pattern, (Delegate)ReceiveUpdate);
|
_botHost.MapPost(pattern, (Delegate)ReceiveUpdate);
|
||||||
|
|
||||||
_botClient.SetWebhook(
|
await _botClient.SetWebhook(
|
||||||
url: _options.WebhookUri,
|
url: _options.WebhookUri,
|
||||||
maxConnections: _options.MaxConnections,
|
maxConnections: _options.MaxConnections,
|
||||||
allowedUpdates: _botHost.UpdateRouter.HandlersProvider.AllowedTypes,
|
allowedUpdates: _botHost.UpdateRouter.HandlersProvider.AllowedTypes,
|
||||||
dropPendingUpdates: _options.DropPendingUpdates,
|
dropPendingUpdates: _options.DropPendingUpdates,
|
||||||
cancellationToken: cancellationToken)
|
cancellationToken: cancellationToken);
|
||||||
.Wait(cancellationToken);
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
Reference in New Issue
Block a user