pub enum ChatType {
    Private {
        username: Option<String>,
        first_name: String,
        last_name: Option<String>,
    },
    Group {
        title: String,
        username: Option<String>,
        all_members_are_administrators: bool,
    },
    Supergroup {
        title: String,
        username: Option<String>,
        all_members_are_administrators: bool,
        pinned_message: Option<Box<Message>>,
        sticker_set_name: Option<String>,
        can_set_sticker_set: Option<bool>,
        invite_link: Option<String>,
        description: Option<String>,
    },
    Channel {
        title: String,
        username: Option<String>,
        pinned_message: Option<Box<Message>>,
        invite_link: Option<String>,
        description: Option<String>,
    },
    Unknown,
}
Expand description

Type of chat

Variants

Private

Fields

username: Option<String>
first_name: String

First name of the other party in a private chat

last_name: Option<String>

Last name of the other party in a private chat

Group

Fields

title: String
username: Option<String>
all_members_are_administrators: bool

True if a group has ‘All Members Are Admins’ enabled.

Supergroup

Fields

title: String
username: Option<String>
all_members_are_administrators: bool

True if a group has ‘All Members Are Admins’ enabled.

pinned_message: Option<Box<Message>>

Pinned message. Returned only in getChat.

sticker_set_name: Option<String>

Name of group sticker set. Returned only in getChat.

can_set_sticker_set: Option<bool>

True, if the bot can change the group sticker set. Returned only in getChat.

invite_link: Option<String>

Chat invite link/ Returned only in getChat.

description: Option<String>

Description. Returned only in getChat.

Channel

Fields

title: String
username: Option<String>
pinned_message: Option<Box<Message>>

Pinned message. Returned only in getChat.

invite_link: Option<String>

Chat invite link. Returned only in getChat.

description: Option<String>

Description. Returned only in getChat.

Unknown

Unknown upstream data type.

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
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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

Returns the argument unchanged.

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.