diff --git a/src/api_params.rs b/src/api_params.rs index 4259bd0..8e25503 100644 --- a/src/api_params.rs +++ b/src/api_params.rs @@ -878,6 +878,10 @@ pub struct SendVideoNoteParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendPaidMediaParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + pub chat_id: ChatId, pub star_count: u32, @@ -1557,6 +1561,33 @@ pub struct EditChatInviteLinkParams { pub creates_join_request: Option, } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +pub struct CreateChatSubscriptionInviteLinkParams { + #[builder(setter(into))] + pub chat_id: ChatId, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub name: Option, + + pub subscription_period: u32, + + pub subscription_price: u16, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +pub struct EditChatSubscriptionInviteLinkParams { + #[builder(setter(into))] + pub chat_id: ChatId, + + #[builder(setter(into))] + pub invite_link: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub name: Option, +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct RevokeChatInviteLinkParams { #[builder(setter(into))] diff --git a/src/api_traits/async_telegram_api.rs b/src/api_traits/async_telegram_api.rs index 01cb6dd..f72e1db 100644 --- a/src/api_traits/async_telegram_api.rs +++ b/src/api_traits/async_telegram_api.rs @@ -14,6 +14,7 @@ use crate::api_params::CloseGeneralForumTopicParams; use crate::api_params::CopyMessageParams; use crate::api_params::CopyMessagesParams; use crate::api_params::CreateChatInviteLinkParams; +use crate::api_params::CreateChatSubscriptionInviteLinkParams; use crate::api_params::CreateForumTopicParams; use crate::api_params::CreateInvoiceLinkParams; use crate::api_params::CreateNewStickerSetParams; @@ -28,6 +29,7 @@ use crate::api_params::DeleteStickerFromSetParams; use crate::api_params::DeleteStickerSetParams; use crate::api_params::DeleteWebhookParams; use crate::api_params::EditChatInviteLinkParams; +use crate::api_params::EditChatSubscriptionInviteLinkParams; use crate::api_params::EditForumTopicParams; use crate::api_params::EditGeneralForumTopicParams; use crate::api_params::EditMessageCaptionParams; @@ -621,6 +623,22 @@ pub trait AsyncTelegramApi { self.request("editChatInviteLink", Some(params)).await } + async fn create_chat_subscription_invite_link( + &self, + params: &CreateChatSubscriptionInviteLinkParams, + ) -> Result, Self::Error> { + self.request("createChatSubscriptionInviteLink", Some(params)) + .await + } + + async fn edit_chat_subscription_invite_link( + &self, + params: &EditChatSubscriptionInviteLinkParams, + ) -> Result, Self::Error> { + self.request("editChatSubscriptionInviteLink", Some(params)) + .await + } + async fn revoke_chat_invite_link( &self, params: &RevokeChatInviteLinkParams, diff --git a/src/api_traits/telegram_api.rs b/src/api_traits/telegram_api.rs index 24aa058..5da9d19 100644 --- a/src/api_traits/telegram_api.rs +++ b/src/api_traits/telegram_api.rs @@ -14,6 +14,7 @@ use crate::api_params::CloseGeneralForumTopicParams; use crate::api_params::CopyMessageParams; use crate::api_params::CopyMessagesParams; use crate::api_params::CreateChatInviteLinkParams; +use crate::api_params::CreateChatSubscriptionInviteLinkParams; use crate::api_params::CreateForumTopicParams; use crate::api_params::CreateInvoiceLinkParams; use crate::api_params::CreateNewStickerSetParams; @@ -28,6 +29,7 @@ use crate::api_params::DeleteStickerFromSetParams; use crate::api_params::DeleteStickerSetParams; use crate::api_params::DeleteWebhookParams; use crate::api_params::EditChatInviteLinkParams; +use crate::api_params::EditChatSubscriptionInviteLinkParams; use crate::api_params::EditForumTopicParams; use crate::api_params::EditGeneralForumTopicParams; use crate::api_params::EditMessageCaptionParams; @@ -583,6 +585,20 @@ pub trait TelegramApi { self.request("editChatInviteLink", Some(params)) } + fn create_chat_subscription_invite_link( + &self, + params: &CreateChatSubscriptionInviteLinkParams, + ) -> Result, Self::Error> { + self.request("createChatSubscriptionInviteLink", Some(params)) + } + + fn edit_chat_subscription_invite_link( + &self, + params: &EditChatSubscriptionInviteLinkParams, + ) -> Result, Self::Error> { + self.request("editChatSubscriptionInviteLink", Some(params)) + } + fn revoke_chat_invite_link( &self, params: &RevokeChatInviteLinkParams, diff --git a/src/objects.rs b/src/objects.rs index 75ed216..ea262b0 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -264,6 +264,10 @@ pub struct ChatMemberAdministrator { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct ChatMemberMember { pub user: User, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub until_date: Option, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] @@ -2293,6 +2297,7 @@ pub struct ChatLocation { pub enum ReactionType { Emoji(ReactionTypeEmoji), CustomEmoji(ReactionTypeCustomEmoji), + Paid(ReactionTypePaid), } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder, Eq)] @@ -2307,6 +2312,9 @@ pub struct ReactionTypeCustomEmoji { pub custom_emoji_id: String, } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder, Eq)] +pub struct ReactionTypePaid {} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct ReactionCount { #[builder(setter(into))] @@ -4249,6 +4257,10 @@ pub struct TransactionPartnerUser { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub invoice_payload: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub paid_media: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]