fix: skip stale pending updates on startup
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
using Telegram.Bot.Types.Enums;
|
||||
|
||||
namespace GmRelay.Bot.Infrastructure.Telegram;
|
||||
|
||||
public sealed class TelegramUpdateSource(ITelegramBotClient bot) : ITelegramUpdateSource
|
||||
{
|
||||
public Task<Update[]> GetUpdatesAsync(
|
||||
int offset,
|
||||
int? limit = null,
|
||||
int? timeout = null,
|
||||
IEnumerable<UpdateType>? allowedUpdates = null,
|
||||
CancellationToken cancellationToken = default) =>
|
||||
bot.GetUpdates(
|
||||
offset: offset,
|
||||
limit: limit,
|
||||
timeout: timeout,
|
||||
allowedUpdates: allowedUpdates,
|
||||
cancellationToken: cancellationToken);
|
||||
}
|
||||
Reference in New Issue
Block a user