From c00c2e8d8f14df8121158faa13c279bdfccd0441 Mon Sep 17 00:00:00 2001 From: FlorianDahn Date: Sat, 25 Jul 2020 15:08:55 +0200 Subject: [PATCH] Update DeviceSession.cs - adding Unban method --- TelegramBotBase/Sessions/DeviceSession.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/TelegramBotBase/Sessions/DeviceSession.cs b/TelegramBotBase/Sessions/DeviceSession.cs index 5050c80..1574de0 100644 --- a/TelegramBotBase/Sessions/DeviceSession.cs +++ b/TelegramBotBase/Sessions/DeviceSession.cs @@ -135,6 +135,7 @@ namespace TelegramBotBase.Sessions this.ActiveForm.Device = this; } + /// /// Edits the text message /// @@ -723,6 +724,19 @@ namespace TelegramBotBase.Sessions } } + public virtual async Task UnbanUser(int userId) + { + try + { + await this.Client.TelegramClient.UnbanChatMemberAsync(this.DeviceId, userId); + } + catch + { + + } + } + + /// /// Eventhandler for sent messages