mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
+PinChatMessage
This commit is contained in:
parent
ccbfee24b8
commit
8211838fe9
2 changed files with 33 additions and 0 deletions
|
@ -97,6 +97,7 @@ pub mod get_file;
|
|||
pub mod get_me;
|
||||
pub mod get_user_profile_photos;
|
||||
pub mod kick_chat_member;
|
||||
pub mod pin_chat_message;
|
||||
pub mod restrict_chat_member;
|
||||
pub mod send_audio;
|
||||
pub mod send_chat_action;
|
||||
|
|
32
src/core/requests/pin_chat_message.rs
Normal file
32
src/core/requests/pin_chat_message.rs
Normal file
|
@ -0,0 +1,32 @@
|
|||
use crate::core::requests::{ChatId, RequestContext, RequestFuture, ResponseResult, Request};
|
||||
use crate::core::network;
|
||||
|
||||
/// Use this method to get up to date information about the chat
|
||||
/// (current name of the user for one-on-one conversations,
|
||||
/// current username of a user, group or channel, etc.).
|
||||
/// Returns a Chat object on success.
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct PinChatMessage<'a> {
|
||||
#[serde(skip_serializing)]
|
||||
ctx: RequestContext<'a>,
|
||||
/// Unique identifier for the target chat or username
|
||||
/// of the target supergroup or channel (in the format @channelusername)
|
||||
chat_id: ChatId,
|
||||
message_id: i32,
|
||||
disable_notification: bool
|
||||
}
|
||||
|
||||
impl<'a> Request<'a> for PinChatMessage<'a> {
|
||||
type ReturnValue = bool;
|
||||
|
||||
fn send(self) -> RequestFuture<'a, ResponseResult<Self::ReturnValue>> {
|
||||
Box::pin(async move {
|
||||
network::request_json(
|
||||
&self.ctx.client,
|
||||
&self.ctx.token,
|
||||
"pinChatMessage",
|
||||
&self,
|
||||
).await
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue