diff --git a/src/api_params.rs b/src/api_params.rs index 4769160..939b3c9 100644 --- a/src/api_params.rs +++ b/src/api_params.rs @@ -2031,7 +2031,7 @@ pub struct InlineQueryResultsButton { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendInvoiceParams { - pub chat_id: i64, + pub chat_id: ChatId, #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] @@ -2524,3 +2524,8 @@ pub struct GetChatMenuButtonParams { #[builder(setter(into, strip_option), default)] pub chat_id: Option, } + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +pub struct UnpinAllGeneralForumTopicMessagesParams { + pub chat_id: ChatId, +} diff --git a/src/api_traits/async_telegram_api.rs b/src/api_traits/async_telegram_api.rs index 7e79245..af7c1db 100644 --- a/src/api_traits/async_telegram_api.rs +++ b/src/api_traits/async_telegram_api.rs @@ -132,6 +132,7 @@ use crate::objects::User; use crate::objects::UserProfilePhotos; use crate::objects::WebhookInfo; use crate::Sticker; +use crate::UnpinAllGeneralForumTopicMessagesParams; use async_trait::async_trait; use std::path::PathBuf; @@ -1266,6 +1267,14 @@ pub trait AsyncTelegramApi { self.request("getChatMenuButton", Some(params)).await } + async fn unpin_all_general_forum_topic_messages( + &self, + params: UnpinAllGeneralForumTopicMessagesParams, + ) -> Result, Self::Error> { + self.request("unpinAllGeneralForumTopicMessages", Some(params)) + .await + } + async fn request_without_body( &self, method: &str, diff --git a/src/api_traits/telegram_api.rs b/src/api_traits/telegram_api.rs index 93bbb0f..64f34f7 100644 --- a/src/api_traits/telegram_api.rs +++ b/src/api_traits/telegram_api.rs @@ -132,6 +132,7 @@ use crate::objects::UserProfilePhotos; use crate::objects::WebhookInfo; use crate::GetCustomEmojiStickersParams; use crate::Sticker; +use crate::UnpinAllGeneralForumTopicMessagesParams; use std::path::PathBuf; pub trait TelegramApi { @@ -1204,6 +1205,13 @@ pub trait TelegramApi { self.request("getChatMenuButton", Some(params)) } + fn unpin_all_general_forum_topic_messages( + &self, + params: UnpinAllGeneralForumTopicMessagesParams, + ) -> Result, Self::Error> { + self.request("unpinAllGeneralForumTopicMessages", Some(params)) + } + fn request_without_body( &self, method: &str, diff --git a/src/objects.rs b/src/objects.rs index 841f6d6..6e48013 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -482,6 +482,10 @@ pub struct Chat { #[builder(setter(into, strip_option), default)] pub emoji_status_custom_emoji_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub emoji_status_expiration_date: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub bio: Option, @@ -660,6 +664,10 @@ pub struct Message { #[builder(setter(into, strip_option), default)] pub sticker: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub story: Option>, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub video: Option>, @@ -1084,12 +1092,18 @@ pub struct PollOption { pub voter_count: u32, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] pub struct PollAnswer { #[builder(setter(into))] pub poll_id: String, - pub user: User, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub voter_chat: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub user: Option>, pub option_ids: Vec, } @@ -1787,6 +1801,13 @@ pub struct InputSticker { pub keywords: Option>, } +// https://core.telegram.org/bots/api#story +// This object represents a message about a forwarded story in the chat. +// Currently holds no information. + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct Story {} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] pub struct StickerSet { #[builder(setter(into))]