From 90e37d3058ff1695e2cbc5d4d52011ce4b232bcc Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 19 Apr 2024 14:38:56 +0300 Subject: [PATCH] Bot API 7.2 (#155) * Bot API 7.2 - Integration with Business Accounts * Bot API 7.2 - Working on Behalf of Business Accounts (#156) * Bot API 7.2 - Working on Behalf of Business Accounts * Bot API 7.2 - Information about Business Accounts (#157) * Bot API 7.2 - Information about Business Accounts * Bot API 7.2 - Mixed-Format Sticker Packs (#158) * Bot API 7.2 - Mixed-Format Sticker Packs * Bot API 7.2 - Request Chat Improvements (#159) * Bot API 7.2 - Request Chat Improvements * Bot API 7.2 - Other Changes (#160) --- src/api/telegram_api_impl.rs | 2 +- src/api_params.rs | 91 +++++++++++++- src/api_traits/async_telegram_api.rs | 17 +++ src/api_traits/telegram_api.rs | 17 +++ src/objects.rs | 178 ++++++++++++++++++++++++++- 5 files changed, 297 insertions(+), 8 deletions(-) diff --git a/src/api/telegram_api_impl.rs b/src/api/telegram_api_impl.rs index e14a297..a2b6d7a 100644 --- a/src/api/telegram_api_impl.rs +++ b/src/api/telegram_api_impl.rs @@ -1750,7 +1750,7 @@ mod tests { #[test] fn get_sticker_set_success() { - let response_string = "{\"ok\":true,\"result\":{\"name\":\"unocards\",\"title\":\"UNO Bot\",\"sticker_type\":\"regular\",\"is_animated\":false,\"is_video\":false,\"contains_masks\":false,\"stickers\":[{\"file_id\":\"CAACAgQAAxUAAWCDxAQVJ6X7FGiBD5NyjN5DDvgfAALZAQACX1eZAAEqnpNt3SpG_x8E\",\"file_unique_id\":\"AgAD2QEAAl9XmQAB\",\"type\":\"regular\",\"width\":342,\"height\":512,\"is_animated\":false,\"is_video\":false,\"thumbnail\":{\"file_id\":\"AAMCBAADFQABYIPEBBUnpfsUaIEPk3KM3kMO-B8AAtkBAAJfV5kAASqek23dKkb_P75BGQAEAQAHbQADBBEAAh8E\",\"file_unique_id\":\"AQADP75BGQAEBBEAAg\",\"width\":85,\"height\":128,\"file_size\":2452},\"emoji\":\"dd\",\"set_name\":\"unocards\",\"file_size\":8898}]}}"; + let response_string = "{\"ok\":true,\"result\":{\"name\":\"unocards\",\"title\":\"UNO Bot\",\"sticker_type\":\"regular\",\"contains_masks\":false,\"stickers\":[{\"file_id\":\"CAACAgQAAxUAAWCDxAQVJ6X7FGiBD5NyjN5DDvgfAALZAQACX1eZAAEqnpNt3SpG_x8E\",\"file_unique_id\":\"AgAD2QEAAl9XmQAB\",\"type\":\"regular\",\"width\":342,\"height\":512,\"is_animated\":false,\"is_video\":false,\"thumbnail\":{\"file_id\":\"AAMCBAADFQABYIPEBBUnpfsUaIEPk3KM3kMO-B8AAtkBAAJfV5kAASqek23dKkb_P75BGQAEAQAHbQADBBEAAh8E\",\"file_unique_id\":\"AQADP75BGQAEBBEAAg\",\"width\":85,\"height\":128,\"file_size\":2452},\"emoji\":\"dd\",\"set_name\":\"unocards\",\"file_size\":8898}]}}"; let params = GetStickerSetParams::builder().name("unocards").build(); let mut server = mockito::Server::new(); diff --git a/src/api_params.rs b/src/api_params.rs index 0f925f4..a0520bf 100644 --- a/src/api_params.rs +++ b/src/api_params.rs @@ -278,6 +278,10 @@ pub struct DeleteWebhookParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendMessageParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -435,6 +439,10 @@ pub struct CopyMessagesParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendPhotoParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -480,6 +488,10 @@ pub struct SendPhotoParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendAudioParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -537,6 +549,10 @@ pub struct SendAudioParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendDocumentParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -586,6 +602,10 @@ pub struct SendDocumentParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendVideoParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -651,6 +671,10 @@ pub struct SendVideoParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendAnimationParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -712,6 +736,10 @@ pub struct SendAnimationParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendVoiceParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -757,6 +785,10 @@ pub struct SendVoiceParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendVideoNoteParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -798,6 +830,10 @@ pub struct SendVideoNoteParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendMediaGroupParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -822,6 +858,10 @@ pub struct SendMediaGroupParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] pub struct SendLocationParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -922,6 +962,10 @@ pub struct StopMessageLiveLocationParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] pub struct SendVenueParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -974,6 +1018,10 @@ pub struct SendVenueParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendContactParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -1014,6 +1062,10 @@ pub struct SendContactParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendPollParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -1085,6 +1137,10 @@ pub struct SendPollParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendDiceParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -1115,6 +1171,10 @@ pub struct SendDiceParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendChatActionParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -1630,6 +1690,12 @@ pub struct GetUserChatBoostsParams { pub user_id: u64, } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +pub struct GetBusinessConnectionParams { + #[builder(setter(into))] + pub business_connection_id: String, +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SetMyCommandsParams { pub commands: Vec, @@ -1855,6 +1921,10 @@ pub struct DeleteMessagesParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendStickerParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat_id: ChatId, @@ -1913,8 +1983,6 @@ pub struct CreateNewStickerSetParams { pub stickers: Vec, - pub sticker_format: StickerFormat, - #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option))] pub sticker_type: Option, @@ -1954,6 +2022,19 @@ pub struct DeleteStickerFromSetParams { pub sticker: String, } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct ReplaceStickerInSetParams { + pub user_id: u64, + + #[builder(setter(into))] + pub name: String, + + #[builder(setter(into))] + pub old_sticker: String, + + pub sticker: InputSticker, +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SetStickerEmojiListParams { #[builder(setter(into))] @@ -2001,6 +2082,8 @@ pub struct SetStickerSetThumbnailParams { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub thumbnail: Option, + + pub format: StickerFormat, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] @@ -2272,6 +2355,10 @@ pub struct SetPassportDataErrorsParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct SendGameParams { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + pub chat_id: i64, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/api_traits/async_telegram_api.rs b/src/api_traits/async_telegram_api.rs index 85edcb7..aad0d64 100644 --- a/src/api_traits/async_telegram_api.rs +++ b/src/api_traits/async_telegram_api.rs @@ -39,6 +39,7 @@ use crate::api_params::ExportChatInviteLinkParams; use crate::api_params::FileUpload; use crate::api_params::ForwardMessageParams; use crate::api_params::ForwardMessagesParams; +use crate::api_params::GetBusinessConnectionParams; use crate::api_params::GetChatAdministratorsParams; use crate::api_params::GetChatMemberCountParams; use crate::api_params::GetChatMemberParams; @@ -64,6 +65,7 @@ use crate::api_params::PinChatMessageParams; use crate::api_params::PromoteChatMemberParams; use crate::api_params::ReopenForumTopicParams; use crate::api_params::ReopenGeneralForumTopicParams; +use crate::api_params::ReplaceStickerInSetParams; use crate::api_params::RestrictChatMemberParams; use crate::api_params::RevokeChatInviteLinkParams; use crate::api_params::SendAnimationParams; @@ -119,6 +121,7 @@ use crate::objects::BotCommand; use crate::objects::BotDescription; use crate::objects::BotName; use crate::objects::BotShortDescription; +use crate::objects::BusinessConnection; use crate::objects::Chat; use crate::objects::ChatAdministratorRights; use crate::objects::ChatInviteLink; @@ -824,6 +827,13 @@ pub trait AsyncTelegramApi { self.request("getUserChatBoosts", Some(params)).await } + async fn get_business_connection( + &self, + params: &GetBusinessConnectionParams, + ) -> Result, Self::Error> { + self.request("getBusinessConnection", Some(params)).await + } + async fn get_my_commands( &self, params: &GetMyCommandsParams, @@ -1165,6 +1175,13 @@ pub trait AsyncTelegramApi { self.request("setStickerPositionInSet", Some(params)).await } + async fn replace_sticker_in_set( + &self, + params: &ReplaceStickerInSetParams, + ) -> Result, Self::Error> { + self.request("replaceStickerInSet", Some(params)).await + } + async fn delete_sticker_from_set( &self, params: &DeleteStickerFromSetParams, diff --git a/src/api_traits/telegram_api.rs b/src/api_traits/telegram_api.rs index 1fa8271..d08abc8 100644 --- a/src/api_traits/telegram_api.rs +++ b/src/api_traits/telegram_api.rs @@ -39,6 +39,7 @@ use crate::api_params::ExportChatInviteLinkParams; use crate::api_params::FileUpload; use crate::api_params::ForwardMessageParams; use crate::api_params::ForwardMessagesParams; +use crate::api_params::GetBusinessConnectionParams; use crate::api_params::GetChatAdministratorsParams; use crate::api_params::GetChatMemberCountParams; use crate::api_params::GetChatMemberParams; @@ -63,6 +64,7 @@ use crate::api_params::PinChatMessageParams; use crate::api_params::PromoteChatMemberParams; use crate::api_params::ReopenForumTopicParams; use crate::api_params::ReopenGeneralForumTopicParams; +use crate::api_params::ReplaceStickerInSetParams; use crate::api_params::RestrictChatMemberParams; use crate::api_params::RevokeChatInviteLinkParams; use crate::api_params::SendAnimationParams; @@ -118,6 +120,7 @@ use crate::objects::BotCommand; use crate::objects::BotDescription; use crate::objects::BotName; use crate::objects::BotShortDescription; +use crate::objects::BusinessConnection; use crate::objects::Chat; use crate::objects::ChatAdministratorRights; use crate::objects::ChatInviteLink; @@ -779,6 +782,13 @@ pub trait TelegramApi { self.request("getUserChatBoosts", Some(params)) } + fn get_business_connection( + &self, + params: &GetBusinessConnectionParams, + ) -> Result, Self::Error> { + self.request("getBusinessConnection", Some(params)) + } + fn get_my_commands( &self, params: &GetMyCommandsParams, @@ -1117,6 +1127,13 @@ pub trait TelegramApi { self.request("deleteStickerFromSet", Some(params)) } + fn replace_sticker_in_set( + &self, + params: &ReplaceStickerInSetParams, + ) -> Result, Self::Error> { + self.request("replaceStickerInSet", Some(params)) + } + fn set_sticker_emoji_list( &self, params: &SetStickerEmojiListParams, diff --git a/src/objects.rs b/src/objects.rs index b5e45d4..49312df 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -347,6 +347,10 @@ pub enum UpdateContent { EditedMessage(Message), ChannelPost(Message), EditedChannelPost(Message), + BusinessConnection(BusinessConnection), + BusinessMessage(Message), + EditedBusinessMessage(Message), + DeletedBusinessMessages(BusinessMessagesDeleted), MessageReaction(MessageReactionUpdated), MessageReactionCount(MessageReactionCountUpdated), InlineQuery(InlineQuery), @@ -464,6 +468,10 @@ pub struct User { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub supports_inline_queries: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_connect_to_business: Option, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] @@ -501,6 +509,26 @@ pub struct Chat { #[builder(setter(into, strip_option), default)] pub active_usernames: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub birthdate: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_intro: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_location: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_opening_hours: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub personal_chat: Option>, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub available_reactions: Option>, @@ -634,8 +662,16 @@ pub struct Message { #[builder(setter(into, strip_option), default)] pub sender_boost_count: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub sender_business_bot: Option>, + pub date: u64, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub business_connection_id: Option, + #[builder(setter(into))] pub chat: Box, @@ -679,6 +715,10 @@ pub struct Message { #[builder(setter(into, strip_option), default)] pub has_protected_content: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub is_from_offline: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub media_group_id: Option, @@ -1506,11 +1546,32 @@ pub struct GeneralForumTopicHidden {} #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct GeneralForumTopicUnhidden {} +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +pub struct SharedUser { + pub user_id: u64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub first_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub last_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub username: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub photo: Option>, +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct UsersShared { pub request_id: i32, - pub user_ids: Vec, + pub users: Vec, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] @@ -1518,6 +1579,18 @@ pub struct ChatShared { pub request_id: i32, pub chat_id: u64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub title: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub username: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub photo: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] @@ -1641,6 +1714,18 @@ pub struct KeyboardButtonRequestUsers { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub max_quantity: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub request_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub request_username: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub request_photo: Option, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] @@ -1672,6 +1757,18 @@ pub struct KeyboardButtonRequestChat { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub bot_is_member: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub request_title: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub request_username: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub request_photo: Option, } #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Builder)] @@ -1963,6 +2060,54 @@ pub struct ChatPermissions { pub can_manage_topics: Option, } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +pub struct Birthdate { + pub day: u8, + + pub month: u8, + + pub year: u16, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct BusinessIntro { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub title: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub message: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub sticker: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct BusinessLocation { + #[builder(setter(into))] + pub address: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub location: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct BusinessOpeningHoursInterval { + pub opening_minute: u16, + + pub closing_minute: u16, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct BusinessOpeningHours { + pub time_zone_name: String, + + pub opening_hours: Vec, +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] pub struct ChatLocation { pub location: Location, @@ -2120,6 +2265,7 @@ pub struct Sticker { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] pub struct InputSticker { pub sticker: FileUpload, + pub format: StickerFormat, pub emoji_list: Vec, #[serde(skip_serializing_if = "Option::is_none")] @@ -2148,10 +2294,6 @@ pub struct StickerSet { #[serde(rename = "sticker_type")] pub sticker_type: StickerType, - pub is_animated: bool, - - pub is_video: bool, - #[doc(hidden)] #[deprecated(since = "0.19.2", note = "Please use `sticker_type` instead")] pub contains_masks: bool, @@ -3727,6 +3869,32 @@ pub struct UserChatBoosts { pub boosts: Vec, } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] +pub struct BusinessConnection { + #[builder(setter(into))] + pub id: String, + + pub user: User, + + pub user_chat_id: u64, + + pub date: u64, + + pub can_reply: bool, + + pub is_enabled: bool, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct BusinessMessagesDeleted { + #[builder(setter(into))] + pub business_connection_id: String, + + pub chat: Chat, + + pub message_ids: Vec, +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(untagged)] pub enum MaybeInaccessibleMessage {