pub enum ChatMemberKind {
    Owner(Owner),
    Administrator(Administrator),
    Member,
    Restricted(Restricted),
    Left,
    Banned(Banned),
}

Variants§

§

Owner(Owner)

§

Administrator(Administrator)

§

Member

§

Restricted(Restricted)

§

Left

§

Banned(Banned)

Implementations§

Simple methods for checking a user status.

Returns chat member status.

Returns true if the user is the owner of the given chat.

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.

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 ChatMemberKind::Member variant which is not enough to determine if the user is joinned to the chat. Use is_present for that instead.

Returns true if the user is restricted in the given chat.

Returns true if the user left the given chat.

⚠️ Don’t confuse this with is_present. This method merely checks for ChatMemberKind::Left variant which is not enough to determine if the user is joinned to the chat. Use is_present for that instead.

Returns true if the user is banned in the given chat.

👎Deprecated: use is_banned instead

Returns true if the user is kicked from the given chat.

👎Deprecated: use is_owner instead

Returns true if the user is the creator (owner) of the given chat.

Compound methods for checking a user status.

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.

Returns true if the user is currently present in the chat. i.e. if the user hasn’t left or been banned. It also returns false if the user left the chat, but was restricted.

Returns true if the user’s presence in the chat is hidden.

I.e. returns true if the user is the owner of the chat or an administrator in the chat and has the can_manage_chat privilege. Returns false otherwise.

Methods for checking admin privileges.

Returns true if the user is an administrator in the given chat and the bot is allowed to edit administrator privileges of that user.

Returns true if the user can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege.

I.e. returns true if the user

  • is the owner of the chat
  • is an administrator in the given chat and has can_manage_chat privilege. Returns false otherwise.
👎Deprecated since 0.9.0: Match manually and use can_change_info field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user can change the chat title, photo and other settings.

I.e. returns true if the user

source

pub fn can_post_messages(&self) -> bool

Returns true if the user can post in the channel, channels only.

I.e. returns true if the user

  • is the owner of the chat (even if the chat is not a channel)
  • is an administrator in the given chat and has can_post_messages privilege. Returns false otherwise.

Returns true if the user can edit messages of other users and can pin messages, channels only.

I.e. returns true if the user

  • is the owner of the chat (even if the chat is not a channel)
  • is an administrator in the given chat and has the can_edit_messages privilege. Returns false otherwise.

Returns true if the user can delete messages of other users.

I.e. returns true if the user

  • is the owner of the chat
  • is an administrator in the given chat and has the can_delete_messages privilege. Returns false otherwise.

Returns true if the user can manage video chats.

I.e. returns true if the user

  • is the owner of the chat
  • is an administrator in the given chat and has the can_manage_video_chats privilege. Returns false otherwise.
👎Deprecated since 0.6.0: renamed to can_manage_video_chats
👎Deprecated since 0.9.0: Match manually and use can_invite_users field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user can can invite new users to the chat.

I.e. returns true if the user

Returns true if the user can restrict, ban or unban chat members.

I.e. returns true if the user

  • is the owner of the chat
  • is an administrator in the given chat and has the can_restrict_members privilege. Returns false otherwise.
👎Deprecated since 0.9.0: Match manually and use can_pin_messages field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user can pin messages, supergroups only.

I.e. returns true if the user

👎Deprecated since 0.9.0: Match manually and use can_manage_topics field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user is allowed to manage topics.

I.e. returns true if the user

Returns true if the user can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user).

I.e. returns true if the user

  • is the owner of the chat (even if the chat is not a channel)
  • is an administrator in the given chat and has the can_promote_members privilege. Returns false otherwise.

Methods for checking member rights.

👎Deprecated since 0.9.0: Match manually and use can_send_messages field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user can send text messages, contacts, locations and venues.

I.e. returns false if the user

  • has left or has been banned in the chat
  • is restricted and doesn’t have the can_send_messages right Returns true otherwise.
👎Deprecated since 0.9.0: Match manually and use can_send_media_messages field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user is allowed to send audios, documents, photos, videos, video notes and voice notes.

I.e. returns false if the user

  • has left or has been banned in the chat
  • is restricted and doesn’t have the can_send_media_messages right Returns true otherwise.
👎Deprecated since 0.9.0: Match manually and use can_send_other_messages field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user is allowed to send animations, games, stickers and use inline bots.

I.e. returns false if the user

  • has left or has been banned from the chat
  • is restricted and doesn’t have the can_send_media_messages right Returns true otherwise.
👎Deprecated since 0.9.0: Match manually and use can_add_web_page_previews field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user is allowed to add web page previews to their messages.

I.e. returns false if the user

  • has left or has been banned from the chat
  • is restricted and doesn’t have the can_send_media_messages right Returns true otherwise.
👎Deprecated since 0.9.0: Match manually and use can_send_polls field directly. Details: https://github.com/teloxide/teloxide/issues/781

Returns true if the user is allowed to send polls.

I.e. returns false if the user

  • has left or has been banned from the chat
  • is restricted and doesn’t have the can_send_polls right Returns true otherwise.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
Unerase this erased pointer. Read more
Available on non-enforce_1_1_0_semantics only.
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Turn this erasable pointer into an erased pointer. Read more

Returns the argument unchanged.

Converts to this type from a reference to the input type.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more