Enum tbot::types::chat::Kind

source ·
#[non_exhaustive]
pub enum Kind {
    Private {
        username: Option<String>,
        first_name: String,
        last_name: Option<String>,
        bio: Option<String>,
    },
    Group {
        title: String,
        description: Option<String>,
        invite_link: Option<String>,
        pinned_message: Option<Box<Message>>,
        permissions: Option<Permissions>,
    },
    Supergroup {
        title: String,
        username: Option<String>,
        description: Option<String>,
        invite_link: Option<String>,
        pinned_message: Option<Box<Message>>,
        slow_mode_delay: Option<u64>,
        sticker_set_name: Option<String>,
        can_set_sticker_set: Option<bool>,
        permissions: Option<Permissions>,
        location: Option<Location>,
        linked_chat_id: Option<Id>,
    },
    Channel {
        title: String,
        username: Option<String>,
        description: Option<String>,
        invite_link: Option<String>,
        pinned_message: Option<Box<Message>>,
        linked_chat_id: Option<Id>,
    },
}
Expand description

Represents the kind of a chat.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Private

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§username: Option<String>

The username of the user.

§first_name: String

The first name of the user.

§last_name: Option<String>

The last name of the user.

§bio: Option<String>

The bio of the other party in a private chat. Returned only in GetChat.

The chat is private.

§

Group

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§title: String

The title of the group.

§description: Option<String>

The description of the group.

§invite_link: Option<String>

The invite link of the group.

§pinned_message: Option<Box<Message>>

The pinned message of the group.

§permissions: Option<Permissions>

Default member permissions of the group. Returned only in GetChat.

The chat is a group.

§

Supergroup

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§title: String

The title of the supergroup.

§username: Option<String>

The username of the supergroup.

§description: Option<String>

The description of the supergroup.

§invite_link: Option<String>

The invite link of the supergroup.

§pinned_message: Option<Box<Message>>

The pinned message of the supergroup.

§slow_mode_delay: Option<u64>

The minimum allowed delay between messages in the supergroup. Returned only in GetChat.

§sticker_set_name: Option<String>

The name of the sticker set of the supergroup.

§can_set_sticker_set: Option<bool>

true if the bot can set the sticker set of the supergroup.

§permissions: Option<Permissions>

Default member permissions of the supergroup. Returned only in GetChat.

§location: Option<Location>

For supergroups, the location to which the supergroup is connected. Returned only in GetChat.

§linked_chat_id: Option<Id>

If this supergroup is linked to a channel, this field contains the channel’s ID. Returned only in GetChat.

The chat is a supergroup.

§

Channel

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§title: String

The title of the channel.

§username: Option<String>

The username of the channel.

§description: Option<String>

The description of the channel.

§invite_link: Option<String>

The invite link of the channel.

§pinned_message: Option<Box<Message>>

The pinned message of the channel.

§linked_chat_id: Option<Id>

If this channel has a discussion group, this field contains the group’s ID. Returned only in GetChat.

The chat is a channel.

Implementations§

Returns true if self is of variant Private.

Returns true if self is of variant Group.

Returns true if self is of variant Supergroup.

Returns true if self is of variant Channel.

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
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.

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.

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
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.

Should always be Self
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
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