diff --git a/Core/Handler/CommonHandler.cs b/Core/Handler/CommonHandler.cs index e606d20..15b75ba 100644 --- a/Core/Handler/CommonHandler.cs +++ b/Core/Handler/CommonHandler.cs @@ -41,10 +41,7 @@ public abstract class CommonHandler : BotEventHandler await Bot.RestrictChatMember( Chat.Id, userId, - new ChatPermissions - { - CanSendMessages = false - }, + new ChatPermissions(), untilDate: banEnd ); } diff --git a/modules/ChatManagement/Handler/Ban.cs b/modules/ChatManagement/Handler/Ban.cs index dc6a547..5f9bb9b 100644 --- a/modules/ChatManagement/Handler/Ban.cs +++ b/modules/ChatManagement/Handler/Ban.cs @@ -60,25 +60,8 @@ public class Ban : CommonHandler return; } - // TODO: in Telegram.Bot >=22.4.0 this could be replaced with new ChatPermissions(true) await Bot.RestrictChatMember(Chat.Id, RepliedUser!.Id, - new ChatPermissions - { - CanSendMessages = true, - CanAddWebPagePreviews = true, - CanChangeInfo = true, - CanInviteUsers = true, - CanManageTopics = true, - CanPinMessages = true, - CanSendAudios = true, - CanSendDocuments = true, - CanSendOtherMessages = true, - CanSendPhotos = true, - CanSendPolls = true, - CanSendVideos = true, - CanSendVideoNotes = true, - CanSendVoiceNotes = true, - }); + new ChatPermissions(true)); await Reply($"{From.ToHtml()} разблокировал {RepliedUser!.ToHtml()}"); }