From 2fc4f0af4ce6a93768ff703c48c6f3968859ced9 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Sat, 14 Oct 2023 21:03:00 +0300 Subject: [PATCH] add `unpin_all_chat_messages` method fixes https://github.com/ayrat555/frankenstein/issues/121 --- src/api_traits/async_telegram_api.rs | 8 ++++++++ src/api_traits/telegram_api.rs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/api_traits/async_telegram_api.rs b/src/api_traits/async_telegram_api.rs index af7c1db..ff045d3 100644 --- a/src/api_traits/async_telegram_api.rs +++ b/src/api_traits/async_telegram_api.rs @@ -106,6 +106,7 @@ use crate::api_params::StopPollParams; use crate::api_params::UnbanChatMemberParams; use crate::api_params::UnbanChatSenderChatParams; use crate::api_params::UnhideGeneralForumTopicParams; +use crate::api_params::UnpinAllChatMessagesParams; use crate::api_params::UnpinAllForumTopicMessagesParams; use crate::api_params::UnpinChatMessageParams; use crate::api_params::UploadStickerFileParams; @@ -645,6 +646,13 @@ pub trait AsyncTelegramApi { self.request("unpinChatMessage", Some(params)).await } + fn unpin_all_chat_messages( + &self, + params: &UnpinAllChatMessagesParams, + ) -> Result, Self::Error> { + self.request("unpinAllChatMessages", Some(params)).await + } + async fn leave_chat( &self, params: &LeaveChatParams, diff --git a/src/api_traits/telegram_api.rs b/src/api_traits/telegram_api.rs index 64f34f7..e29e837 100644 --- a/src/api_traits/telegram_api.rs +++ b/src/api_traits/telegram_api.rs @@ -105,6 +105,7 @@ use crate::api_params::StopPollParams; use crate::api_params::UnbanChatMemberParams; use crate::api_params::UnbanChatSenderChatParams; use crate::api_params::UnhideGeneralForumTopicParams; +use crate::api_params::UnpinAllChatMessagesParams; use crate::api_params::UnpinAllForumTopicMessagesParams; use crate::api_params::UnpinChatMessageParams; use crate::api_params::UploadStickerFileParams; @@ -606,6 +607,13 @@ pub trait TelegramApi { self.request("unpinChatMessage", Some(params)) } + fn unpin_all_chat_messages( + &self, + params: &UnpinAllChatMessagesParams, + ) -> Result, Self::Error> { + self.request("unpinAllChatMessages", Some(params)) + } + fn leave_chat(&self, params: &LeaveChatParams) -> Result, Self::Error> { self.request("leaveChat", Some(params)) }