22 lines
656 B
C#
22 lines
656 B
C#
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);
|
|
}
|