mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Correct documentation
From the standpoint of telegram supergroup is a channel...
This commit is contained in:
parent
6ebdeb7f01
commit
7bf3894a31
1 changed files with 7 additions and 1 deletions
|
@ -34,12 +34,16 @@ impl ChatId {
|
|||
matches!(self.to_bare(), BareChatId::User(_))
|
||||
}
|
||||
|
||||
/// Returns `true` if this is an id of a group or supergroup.
|
||||
/// Returns `true` if this is an id of a group.
|
||||
///
|
||||
/// Note: supergroup is **not** considered a group.
|
||||
pub fn is_group(self) -> bool {
|
||||
matches!(self.to_bare(), BareChatId::Group(_))
|
||||
}
|
||||
|
||||
/// Returns `true` if this is an id of a channel.
|
||||
///
|
||||
/// Note: supergroup is considered a channel.
|
||||
pub fn is_channel(self) -> bool {
|
||||
matches!(self.to_bare(), BareChatId::Channel(_))
|
||||
}
|
||||
|
@ -138,6 +142,8 @@ mod tests {
|
|||
51,
|
||||
777000,
|
||||
1000000,
|
||||
617136926,
|
||||
1666111087,
|
||||
1 << 20,
|
||||
(1 << 35) | 123456,
|
||||
1 << 40 - 1,
|
||||
|
|
Loading…
Reference in a new issue