mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +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(_))
|
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 {
|
pub fn is_group(self) -> bool {
|
||||||
matches!(self.to_bare(), BareChatId::Group(_))
|
matches!(self.to_bare(), BareChatId::Group(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if this is an id of a channel.
|
/// Returns `true` if this is an id of a channel.
|
||||||
|
///
|
||||||
|
/// Note: supergroup is considered a channel.
|
||||||
pub fn is_channel(self) -> bool {
|
pub fn is_channel(self) -> bool {
|
||||||
matches!(self.to_bare(), BareChatId::Channel(_))
|
matches!(self.to_bare(), BareChatId::Channel(_))
|
||||||
}
|
}
|
||||||
|
@ -138,6 +142,8 @@ mod tests {
|
||||||
51,
|
51,
|
||||||
777000,
|
777000,
|
||||||
1000000,
|
1000000,
|
||||||
|
617136926,
|
||||||
|
1666111087,
|
||||||
1 << 20,
|
1 << 20,
|
||||||
(1 << 35) | 123456,
|
(1 << 35) | 123456,
|
||||||
1 << 40 - 1,
|
1 << 40 - 1,
|
||||||
|
|
Loading…
Add table
Reference in a new issue