diff --git a/src/Telegrator.Hosting/Polling/HostedUpdateReceiver.cs b/src/Telegrator.Hosting/Polling/HostedUpdateReceiver.cs index deab9c2..06489b8 100644 --- a/src/Telegrator.Hosting/Polling/HostedUpdateReceiver.cs +++ b/src/Telegrator.Hosting/Polling/HostedUpdateReceiver.cs @@ -25,6 +25,9 @@ public class HostedUpdateReceiver(ITelegramBotClient botClient, IUpdateRouter up { logger.LogInformation("Starting receiving updates via long-polling"); _receiverOptions.AllowedUpdates = _updateRouter.HandlersProvider.AllowedTypes.ToArray(); + + botClient.DeleteWebhook(options.Value.DropPendingUpdates).Wait(); + DefaultUpdateReceiver updateReceiver = new DefaultUpdateReceiver(botClient, _receiverOptions); await updateReceiver.ReceiveAsync(_updateRouter, stoppingToken).ConfigureAwait(false); }