diff --git a/crates/teloxide-core/src/types/chat.rs b/crates/teloxide-core/src/types/chat.rs index efa276d2..3bae5341 100644 --- a/crates/teloxide-core/src/types/chat.rs +++ b/crates/teloxide-core/src/types/chat.rs @@ -209,6 +209,13 @@ pub struct PublicChatSupergroup { /// [`GetChat`]: crate::payloads::GetChat pub slow_mode_delay: Option, + /// For supergroups, the minimum number of boosts that a non-administrator + /// user needs to add in order to ignore slow mode and chat permissions. + /// Returned only from [`GetChat`]. + /// + /// [`GetChat`]: crate::payloads::GetChat + pub unrestrict_boost_count: Option, + /// Unique identifier for the linked chat, i.e. the discussion group /// identifier for a channel and vice versa. Returned only in [`GetChat`]. /// @@ -370,6 +377,21 @@ impl Chat { None } + /// Unique identifier for the linked chat, i.e. the discussion group + /// identifier for a channel and vice versa. Returned only in [`GetChat`]. + /// + /// [`GetChat`]: crate::payloads::GetChat + #[must_use] + pub fn unrestrict_boost_count(&self) -> Option { + if let ChatKind::Public(this) = &self.kind { + if let PublicChatKind::Supergroup(this) = &this.kind { + return this.unrestrict_boost_count; + } + } + + None + } + /// The location to which the supergroup is connected. Returned only in /// [`GetChat`]. /// diff --git a/crates/teloxide-core/src/types/message.rs b/crates/teloxide-core/src/types/message.rs index 81e3d5d9..93f5df66 100644 --- a/crates/teloxide-core/src/types/message.rs +++ b/crates/teloxide-core/src/types/message.rs @@ -2116,6 +2116,7 @@ mod tests { can_set_sticker_set: None, permissions: None, slow_mode_delay: None, + unrestrict_boost_count: None, linked_chat_id: None, location: None, join_by_request: None, diff --git a/crates/teloxide-core/src/types/story.rs b/crates/teloxide-core/src/types/story.rs index 65cf8027..0f0ac491 100644 --- a/crates/teloxide-core/src/types/story.rs +++ b/crates/teloxide-core/src/types/story.rs @@ -54,6 +54,7 @@ mod tests { can_set_sticker_set: None, permissions: None, slow_mode_delay: None, + unrestrict_boost_count: None, linked_chat_id: None, location: None, join_to_send_messages: None, diff --git a/crates/teloxide-core/src/types/update.rs b/crates/teloxide-core/src/types/update.rs index 1c8bd13c..68653ca1 100644 --- a/crates/teloxide-core/src/types/update.rs +++ b/crates/teloxide-core/src/types/update.rs @@ -872,6 +872,7 @@ mod test { can_set_sticker_set: None, permissions: None, slow_mode_delay: None, + unrestrict_boost_count: None, linked_chat_id: None, location: None, join_to_send_messages: None,