Skip to content

Commit

Permalink
add unpin_all_chat_messages method
Browse files Browse the repository at this point in the history
fixes #121
  • Loading branch information
ayrat555 committed Oct 14, 2023
1 parent af037f6 commit 2fc4f0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/api_traits/async_telegram_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -645,6 +646,13 @@ pub trait AsyncTelegramApi {
self.request("unpinChatMessage", Some(params)).await
}

fn unpin_all_chat_messages(
&self,
params: &UnpinAllChatMessagesParams,
) -> Result<MethodResponse<bool>, Self::Error> {
self.request("unpinAllChatMessages", Some(params)).await

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test nightly ubuntu-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test beta ubuntu-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test stable ubuntu-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test stable ubuntu-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test nightly ubuntu-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test beta ubuntu-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test stable macos-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test stable macos-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test stable windows-latest --all-features

`await` is only allowed inside `async` functions and blocks

Check failure on line 653 in src/api_traits/async_telegram_api.rs

View workflow job for this annotation

GitHub Actions / Test stable windows-latest --all-features

`await` is only allowed inside `async` functions and blocks
}

async fn leave_chat(
&self,
params: &LeaveChatParams,
Expand Down
8 changes: 8 additions & 0 deletions src/api_traits/telegram_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -606,6 +607,13 @@ pub trait TelegramApi {
self.request("unpinChatMessage", Some(params))
}

fn unpin_all_chat_messages(
&self,
params: &UnpinAllChatMessagesParams,
) -> Result<MethodResponse<bool>, Self::Error> {
self.request("unpinAllChatMessages", Some(params))
}

fn leave_chat(&self, params: &LeaveChatParams) -> Result<MethodResponse<bool>, Self::Error> {
self.request("leaveChat", Some(params))
}
Expand Down

0 comments on commit 2fc4f0a

Please sign in to comment.