Skip to content

Commit

Permalink
updated to the latest version of Telegram.Bot library
Browse files Browse the repository at this point in the history
  • Loading branch information
Szer committed Oct 18, 2024
1 parent 088533c commit 7f25e74
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Telegram.Bot" value="https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion src/VahterBanBot/Bot.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/VahterBanBot/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ if botConf.UsePolling then
let ml = ctx.ServiceProvider.GetRequiredService<MachineLearning>()
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)
Expand Down
2 changes: 1 addition & 1 deletion src/VahterBanBot/VahterBanBot.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="Telegram.Bot" Version="19.0.0" />
<PackageReference Include="Telegram.Bot" Version="21.11.0" />
<PackageReference Include="Microsoft.ML" Version="3.0.1" />
</ItemGroup>

Expand Down

0 comments on commit 7f25e74

Please sign in to comment.