mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Add custom_emoji_sticker_set_name
field and getter
to the `PublicChatSupergroup` struct
This commit is contained in:
parent
221742b98b
commit
44cb9c1ef4
4 changed files with 26 additions and 0 deletions
|
@ -197,6 +197,13 @@ pub struct PublicChatSupergroup {
|
||||||
/// [`GetChat`]: crate::payloads::GetChat
|
/// [`GetChat`]: crate::payloads::GetChat
|
||||||
pub can_set_sticker_set: Option<bool>,
|
pub can_set_sticker_set: Option<bool>,
|
||||||
|
|
||||||
|
/// 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<String>,
|
||||||
|
|
||||||
/// A default chat member permissions, for groups and supergroups.
|
/// A default chat member permissions, for groups and supergroups.
|
||||||
/// Returned only from [`GetChat`].
|
/// Returned only from [`GetChat`].
|
||||||
///
|
///
|
||||||
|
@ -362,6 +369,22 @@ impl Chat {
|
||||||
None
|
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
|
/// The minimum allowed delay between consecutive messages sent by each
|
||||||
/// unpriviledged user. Returned only from [`GetChat`].
|
/// unpriviledged user. Returned only from [`GetChat`].
|
||||||
///
|
///
|
||||||
|
|
|
@ -2114,6 +2114,7 @@ mod tests {
|
||||||
username: None,
|
username: None,
|
||||||
sticker_set_name: None,
|
sticker_set_name: None,
|
||||||
can_set_sticker_set: None,
|
can_set_sticker_set: None,
|
||||||
|
custom_emoji_sticker_set_name: None,
|
||||||
permissions: None,
|
permissions: None,
|
||||||
slow_mode_delay: None,
|
slow_mode_delay: None,
|
||||||
unrestrict_boost_count: None,
|
unrestrict_boost_count: None,
|
||||||
|
|
|
@ -52,6 +52,7 @@ mod tests {
|
||||||
is_forum: false,
|
is_forum: false,
|
||||||
sticker_set_name: None,
|
sticker_set_name: None,
|
||||||
can_set_sticker_set: None,
|
can_set_sticker_set: None,
|
||||||
|
custom_emoji_sticker_set_name: None,
|
||||||
permissions: None,
|
permissions: None,
|
||||||
slow_mode_delay: None,
|
slow_mode_delay: None,
|
||||||
unrestrict_boost_count: None,
|
unrestrict_boost_count: None,
|
||||||
|
|
|
@ -870,6 +870,7 @@ mod test {
|
||||||
is_forum: false,
|
is_forum: false,
|
||||||
sticker_set_name: None,
|
sticker_set_name: None,
|
||||||
can_set_sticker_set: None,
|
can_set_sticker_set: None,
|
||||||
|
custom_emoji_sticker_set_name: None,
|
||||||
permissions: None,
|
permissions: None,
|
||||||
slow_mode_delay: None,
|
slow_mode_delay: None,
|
||||||
unrestrict_boost_count: None,
|
unrestrict_boost_count: None,
|
||||||
|
|
Loading…
Reference in a new issue