From 187400574321dffc236e6166de55a8a3e8cb42c4 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Sat, 23 Sep 2023 19:37:45 +0300 Subject: [PATCH] Bot API 6.9 https://core.telegram.org/bots/api#september-22-2023 --- src/api_params.rs | 12 ++++++++++++ src/objects.rs | 48 +++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 8 deletions(-) diff --git a/src/api_params.rs b/src/api_params.rs index 4769160..4a7ffcf 100644 --- a/src/api_params.rs +++ b/src/api_params.rs @@ -1227,6 +1227,18 @@ pub struct PromoteChatMemberParams { #[builder(setter(into, strip_option), default)] pub can_delete_messages: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_post_stories: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_edit_stories: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_delete_stories: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub can_manage_video_chats: Option, diff --git a/src/objects.rs b/src/objects.rs index 841f6d6..95676cc 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -195,14 +195,6 @@ pub struct ChatMemberAdministrator { pub can_manage_chat: bool, - #[serde(skip_serializing_if = "Option::is_none")] - #[builder(setter(into, strip_option), default)] - pub can_post_messages: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - #[builder(setter(into, strip_option), default)] - pub can_edit_messages: Option, - pub can_delete_messages: bool, pub can_manage_video_chats: bool, @@ -215,10 +207,30 @@ pub struct ChatMemberAdministrator { pub can_invite_users: bool, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_post_messages: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_edit_messages: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub can_pin_messages: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_post_stories: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_edit_stories: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_delete_stories: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub can_manage_topics: Option, @@ -1250,9 +1262,17 @@ pub struct ChatShared { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct WriteAccessAllowed { + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub from_request: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub web_app_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub from_attachment_menu: Option, } #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Builder)] @@ -3190,6 +3210,18 @@ pub struct ChatAdministratorRights { #[builder(setter(into, strip_option), default)] pub can_pin_messages: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_post_stories: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_edit_stories: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[builder(setter(into, strip_option), default)] + pub can_delete_stories: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[builder(setter(into, strip_option), default)] pub can_manage_topics: Option,