From b45566f9433e8f29de9845ee40582783f938b2af Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 4 Jan 2024 23:53:20 +0200 Subject: [PATCH] Bot API 7.0: Other changes --- src/objects.rs | 61 +++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/src/objects.rs b/src/objects.rs index b1eab21..519e6b7 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -503,6 +503,22 @@ pub struct Chat { #[builder(setter(into, strip_option), default)] pub available_reactions: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub accent_color_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub background_custom_emoji_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub profile_accent_color_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub profile_background_custom_emoji_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub emoji_status_custom_emoji_id: Option, @@ -567,6 +583,10 @@ pub struct Chat { #[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 has_visible_history: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub sticker_set_name: Option, @@ -607,27 +627,7 @@ pub struct Message { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] - pub forward_from: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - #[builder(setter(into, strip_option), default)] - pub forward_from_chat: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - #[builder(setter(into, strip_option), default)] - pub forward_from_message_id: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - #[builder(setter(into, strip_option), default)] - pub forward_signature: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - #[builder(setter(into, strip_option), default)] - pub forward_sender_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - #[builder(setter(into, strip_option), default)] - pub forward_date: Option, + pub forward_origin: Option>, #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] @@ -799,7 +799,7 @@ pub struct Message { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] - pub pinned_message: Option>, + pub pinned_message: Option>, #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] @@ -1761,7 +1761,7 @@ pub struct CallbackQuery { #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] - pub message: Option, + pub message: Option, #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] @@ -3701,6 +3701,21 @@ pub struct UserChatBoosts { pub boosts: Vec, } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub enum MaybeInaccessibleMessage { + Message(Message), + InaccessibleMessage(InaccessibleMessage), +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +pub struct InaccessibleMessage { + pub chat: Chat, + + pub message_id: i32, + + pub date: u64, +} + #[cfg(test)] mod serde_tests { use super::*;