From 7f25e747bbdb014019b62244861b898b6a0c7485 Mon Sep 17 00:00:00 2001 From: Ayrat Hudaygulov Date: Fri, 18 Oct 2024 09:34:19 +0100 Subject: [PATCH] updated to the latest version of Telegram.Bot library --- NuGet.Config | 7 +++++++ src/VahterBanBot/Bot.fs | 2 +- src/VahterBanBot/Program.fs | 2 +- src/VahterBanBot/VahterBanBot.fsproj | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 NuGet.Config diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..289d2d7 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/VahterBanBot/Bot.fs b/src/VahterBanBot/Bot.fs index 65d4e5a..f397b85 100644 --- a/src/VahterBanBot/Bot.fs +++ b/src/VahterBanBot/Bot.fs @@ -116,7 +116,7 @@ let softBanInChat (botClient: ITelegramBotClient) (chatId: ChatId) targetUserId ) let untilDate = DateTime.UtcNow.AddHours duration try - do! botClient.RestrictChatMemberAsync(chatId, targetUserId, permissions, Nullable(), untilDate) + do! botClient.RestrictChatMemberAsync(chatId, targetUserId, permissions, untilDate = untilDate) return Ok(chatId, targetUserId) with e -> return Error(chatId, targetUserId, e) diff --git a/src/VahterBanBot/Program.fs b/src/VahterBanBot/Program.fs index 5e093ed..87edd9c 100644 --- a/src/VahterBanBot/Program.fs +++ b/src/VahterBanBot/Program.fs @@ -195,7 +195,7 @@ if botConf.UsePolling then let ml = ctx.ServiceProvider.GetRequiredService() do! onUpdate botUser client botConf logger ml update } - member x.HandlePollingErrorAsync (botClient: ITelegramBotClient, ex: Exception, cancellationToken: CancellationToken) = + member this.HandleErrorAsync(botClient, ``exception``, source, cancellationToken) = Task.CompletedTask } telegramClient.StartReceiving(pollingHandler, null, CancellationToken.None) diff --git a/src/VahterBanBot/VahterBanBot.fsproj b/src/VahterBanBot/VahterBanBot.fsproj index e49d896..717efa3 100644 --- a/src/VahterBanBot/VahterBanBot.fsproj +++ b/src/VahterBanBot/VahterBanBot.fsproj @@ -35,7 +35,7 @@ - +