mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
Add unrestrict_boost_count
field and getter
to the `PublicChatSupergroup` struct
This commit is contained in:
parent
a362e1f825
commit
221742b98b
4 changed files with 25 additions and 0 deletions
|
@ -209,6 +209,13 @@ pub struct PublicChatSupergroup {
|
|||
/// [`GetChat`]: crate::payloads::GetChat
|
||||
pub slow_mode_delay: Option<Seconds>,
|
||||
|
||||
/// 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<u16>,
|
||||
|
||||
/// 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<u16> {
|
||||
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`].
|
||||
///
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue