Enum tbot::types::chat::Kind[][src]

#[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>,
    },
}

Represents the kind of a chat.

Variants (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

The chat is private.

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

Fields of Private

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.

Group

The chat is a group.

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

Fields of Group

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.

Supergroup

The chat is a supergroup.

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

Fields of Supergroup

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.

Channel

The chat is a channel.

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

Fields of Channel

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.

Implementations

impl Kind[src]

pub fn is_private(&self) -> bool[src]

Returns true if self is of variant Private.

pub fn is_group(&self) -> bool[src]

Returns true if self is of variant Group.

pub fn is_supergroup(&self) -> bool[src]

Returns true if self is of variant Supergroup.

pub fn is_channel(&self) -> bool[src]

Returns true if self is of variant Channel.

Trait Implementations

impl Clone for Kind[src]

impl Debug for Kind[src]

impl PartialEq<Kind> for Kind[src]

impl StructuralPartialEq for Kind[src]

Auto Trait Implementations

impl RefUnwindSafe for Kind

impl Send for Kind

impl Sync for Kind

impl Unpin for Kind

impl UnwindSafe for Kind

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.