diff --git a/crates/teloxide-core/src/types/chat.rs b/crates/teloxide-core/src/types/chat.rs index 3bae5341..b4adaa5a 100644 --- a/crates/teloxide-core/src/types/chat.rs +++ b/crates/teloxide-core/src/types/chat.rs @@ -197,6 +197,13 @@ pub struct PublicChatSupergroup { /// [`GetChat`]: crate::payloads::GetChat pub can_set_sticker_set: Option, + /// For supergroups, the name of the group's custom emoji sticker set. + /// Custom emoji from this set can be used by all users and bots in the + /// group. Returned only from [`GetChat`]. + /// + /// [`GetChat`]: crate::payloads::GetChat + pub custom_emoji_sticker_set_name: Option, + /// A default chat member permissions, for groups and supergroups. /// Returned only from [`GetChat`]. /// @@ -362,6 +369,22 @@ impl Chat { None } + /// For supergroups, the name of the group's custom emoji sticker set. + /// Custom emoji from this set can be used by all users and bots in the + /// group. Returned only from [`GetChat`]. + /// + /// [`GetChat`]: crate::payloads::GetChat + #[must_use] + pub fn custom_emoji_sticker_set_name(&self) -> Option<&str> { + if let ChatKind::Public(this) = &self.kind { + if let PublicChatKind::Supergroup(this) = &this.kind { + return this.custom_emoji_sticker_set_name.as_deref(); + } + } + + None + } + /// The minimum allowed delay between consecutive messages sent by each /// unpriviledged user. Returned only from [`GetChat`]. /// diff --git a/crates/teloxide-core/src/types/message.rs b/crates/teloxide-core/src/types/message.rs index 93f5df66..9a749ea9 100644 --- a/crates/teloxide-core/src/types/message.rs +++ b/crates/teloxide-core/src/types/message.rs @@ -2114,6 +2114,7 @@ mod tests { username: None, sticker_set_name: None, can_set_sticker_set: None, + custom_emoji_sticker_set_name: None, permissions: None, slow_mode_delay: None, unrestrict_boost_count: None, diff --git a/crates/teloxide-core/src/types/story.rs b/crates/teloxide-core/src/types/story.rs index 0f0ac491..41ac32c5 100644 --- a/crates/teloxide-core/src/types/story.rs +++ b/crates/teloxide-core/src/types/story.rs @@ -52,6 +52,7 @@ mod tests { is_forum: false, sticker_set_name: None, can_set_sticker_set: None, + custom_emoji_sticker_set_name: None, permissions: None, slow_mode_delay: None, unrestrict_boost_count: None, diff --git a/crates/teloxide-core/src/types/update.rs b/crates/teloxide-core/src/types/update.rs index 68653ca1..92bebc8f 100644 --- a/crates/teloxide-core/src/types/update.rs +++ b/crates/teloxide-core/src/types/update.rs @@ -870,6 +870,7 @@ mod test { is_forum: false, sticker_set_name: None, can_set_sticker_set: None, + custom_emoji_sticker_set_name: None, permissions: None, slow_mode_delay: None, unrestrict_boost_count: None,