Enum tg_flows::ChatMemberStatus
source · pub enum ChatMemberStatus {
Owner,
Administrator,
Member,
Restricted,
Left,
Banned,
}Variants§
Implementations§
source§impl ChatMemberStatus
impl ChatMemberStatus
Simple methods for checking a user status.
sourcepub fn is_administrator(&self) -> bool
pub fn is_administrator(&self) -> bool
Returns true if the user is an administrator of the given chat.
Note: this function doesn’t return true if the user is the
owner of the given chat. See also: is_privileged.
sourcepub fn is_member(&self) -> bool
pub fn is_member(&self) -> bool
Returns true if the user is a common member of the given chat.
⚠️ Don’t confuse this with is_present. This method merely checks
for ChatMemberStatus::Member variant which is not enough to
determine if the user is joinned to the chat. Use is_present for
that instead.
sourcepub fn is_restricted(&self) -> bool
pub fn is_restricted(&self) -> bool
Returns true if the user is restricted in the given chat.
sourcepub fn is_left(&self) -> bool
pub fn is_left(&self) -> bool
Returns true if the user left the given chat.
⚠️ Don’t confuse this with is_present. This method merely checks
for ChatMemberStatus::Left variant which is not enough to determine
if the user is joinned to the chat. Use is_present for that instead.
source§impl ChatMemberStatus
impl ChatMemberStatus
Compound methods for checking a user status.
sourcepub fn is_privileged(&self) -> bool
pub fn is_privileged(&self) -> bool
Returns true if the user is privileged in the given chat. i.e. if the
user is either the owner or an administrator in the given chat.
sourcepub fn is_present(&self) -> bool
👎Deprecated since 0.9.0: Use <code>ChatMemberKind::is_present</code> method instead. Details: https://github.com/teloxide/teloxide/issues/781
pub fn is_present(&self) -> bool
Trait Implementations§
source§impl Clone for ChatMemberStatus
impl Clone for ChatMemberStatus
source§fn clone(&self) -> ChatMemberStatus
fn clone(&self) -> ChatMemberStatus
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ChatMemberStatus
impl Debug for ChatMemberStatus
source§impl<'de> Deserialize<'de> for ChatMemberStatus
impl<'de> Deserialize<'de> for ChatMemberStatus
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Hash for ChatMemberStatus
impl Hash for ChatMemberStatus
source§impl PartialEq<ChatMemberStatus> for ChatMemberStatus
impl PartialEq<ChatMemberStatus> for ChatMemberStatus
source§fn eq(&self, other: &ChatMemberStatus) -> bool
fn eq(&self, other: &ChatMemberStatus) -> bool
self and other values to be equal, and is used
by ==.