From 5613e84bc3723a864e5d28229707cae83cce00d9 Mon Sep 17 00:00:00 2001 From: FlorianDahn Date: Sat, 17 Jul 2021 18:34:27 +0200 Subject: [PATCH] Updating to TelegramBotFramework 16.0.2 ATTENTION: UserIds will no longer be "int", instead it has to be of the long datatype - updating DeviceSession methods for new datatype - updating LinkReplaceTest class example - adding .NET 5 as target framework --- TelegramBotBase/Sessions/DeviceSession.cs | 8 ++++---- TelegramBotBase/TelegramBotBase.csproj | 9 +++++---- TelegramBotBaseTest/Tests/Groups/LinkReplaceTest.cs | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/TelegramBotBase/Sessions/DeviceSession.cs b/TelegramBotBase/Sessions/DeviceSession.cs index 7ce93c1..0e0ce98 100644 --- a/TelegramBotBase/Sessions/DeviceSession.cs +++ b/TelegramBotBase/Sessions/DeviceSession.cs @@ -700,7 +700,7 @@ namespace TelegramBotBase.Sessions #region "Users" - public virtual async Task RestrictUser(int userId, ChatPermissions permissions, DateTime until = default(DateTime)) + public virtual async Task RestrictUser(long userId, ChatPermissions permissions, DateTime until = default(DateTime)) { try { @@ -712,7 +712,7 @@ namespace TelegramBotBase.Sessions } } - public virtual async Task GetChatUser(int userId) + public virtual async Task GetChatUser(long userId) { try { @@ -725,7 +725,7 @@ namespace TelegramBotBase.Sessions return null; } - public virtual async Task KickUser(int userId, DateTime until = default(DateTime)) + public virtual async Task KickUser(long userId, DateTime until = default(DateTime)) { try { @@ -737,7 +737,7 @@ namespace TelegramBotBase.Sessions } } - public virtual async Task UnbanUser(int userId) + public virtual async Task UnbanUser(long userId) { try { diff --git a/TelegramBotBase/TelegramBotBase.csproj b/TelegramBotBase/TelegramBotBase.csproj index 51d72f9..3f7a020 100644 --- a/TelegramBotBase/TelegramBotBase.csproj +++ b/TelegramBotBase/TelegramBotBase.csproj @@ -1,7 +1,7 @@  - netstandard2.1;net472;netcoreapp3.1 + netstandard2.1;net472;net5;netcoreapp3.1 false false true @@ -82,9 +82,10 @@ - - - + + + + diff --git a/TelegramBotBaseTest/Tests/Groups/LinkReplaceTest.cs b/TelegramBotBaseTest/Tests/Groups/LinkReplaceTest.cs index 3ecc6af..d132303 100644 --- a/TelegramBotBaseTest/Tests/Groups/LinkReplaceTest.cs +++ b/TelegramBotBaseTest/Tests/Groups/LinkReplaceTest.cs @@ -12,7 +12,7 @@ namespace TelegramBotBaseTest.Tests.Groups public class LinkReplaceTest : TelegramBotBase.Form.GroupForm { - Dictionary Counter { get; set; } = new Dictionary(); + Dictionary Counter { get; set; } = new Dictionary(); private const int Maximum = 3;