[][src]Enum telegram_bot_raw::types::message::MessageKind

pub enum MessageKind {
    Text {
        data: String,
        entities: Vec<MessageEntity>,
    },
    Audio {
        data: Audio,
    },
    Document {
        data: Document,
        caption: Option<String>,
    },
    Photo {
        data: Vec<PhotoSize>,
        caption: Option<String>,
        media_group_id: Option<String>,
    },
    Sticker {
        data: Sticker,
    },
    Video {
        data: Video,
        caption: Option<String>,
        media_group_id: Option<String>,
    },
    Voice {
        data: Voice,
    },
    VideoNote {
        data: VideoNote,
    },
    Contact {
        data: Contact,
    },
    Location {
        data: Location,
    },
    Poll {
        data: Poll,
    },
    Venue {
        data: Venue,
    },
    NewChatMembers {
        data: Vec<User>,
    },
    LeftChatMember {
        data: User,
    },
    NewChatTitle {
        data: String,
    },
    NewChatPhoto {
        data: Vec<PhotoSize>,
    },
    DeleteChatPhoto,
    GroupChatCreated,
    SupergroupChatCreated,
    ChannelChatCreated,
    MigrateToChatId {
        data: Integer,
    },
    MigrateFromChatId {
        data: Integer,
    },
    PinnedMessage {
        data: Box<MessageOrChannelPost>,
    },
    // some variants omitted
}

Kind of the message.

Variants

Text

Text message.

Fields of Text

data: String

Actual UTF-8 text of the message, 0-4096 characters.

entities: Vec<MessageEntity>

Special entities like usernames, URLs, bot commands, etc. that appear in the text

Audio

Message is an audio file.

Fields of Audio

data: Audio

Information about the file.

Document

Message is a general file.

Fields of Document

data: Document

Information about the file.

caption: Option<String>

Caption for the document, 0-200 characters.

Photo

Message is a photo.

Fields of Photo

data: Vec<PhotoSize>

Available sizes of the photo.

caption: Option<String>

Caption for the photo, 0-200 characters.

media_group_id: Option<String>

The unique identifier of a media message group this message belongs to.

Sticker

Message is a sticker.

Fields of Sticker

data: Sticker

Information about the sticker.

Video

Message is a video.

Fields of Video

data: Video

Information about the video.

caption: Option<String>

Caption for the video, 0-200 characters.

media_group_id: Option<String>

The unique identifier of a media message group this message belongs to.

Voice

Message is a voice message.

Fields of Voice

data: Voice

Information about the file.

VideoNote

Message is a video note.

Fields of VideoNote

data: VideoNote

Information about the file.

Contact

Message is a shared contact.

Fields of Contact

data: Contact

Information about the contact.

Location

Message is a shared location.

Fields of Location

data: Location

Information about the location.

Poll

Message is a poll.

Fields of Poll

data: Poll

Information about the poll.

Venue

Message is a venue.

Fields of Venue

data: Venue

Information about the venue.

NewChatMembers

New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

Fields of NewChatMembers

data: Vec<User>

Information about user (this member may be the bot itself).

LeftChatMember

A member was removed from the group.

Fields of LeftChatMember

data: User

Information about user (this member may be the bot itself).

NewChatTitle

New chat title.

Fields of NewChatTitle

data: String

A chat title was changed to this value.

NewChatPhoto

New chat photo.

Fields of NewChatPhoto

data: Vec<PhotoSize>

A chat photo was change to this value.

DeleteChatPhoto

Service message: the chat photo was deleted.

GroupChatCreated

Service message: the group has been created.

SupergroupChatCreated

Service message: the supergroup has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.

ChannelChatCreated

Service message: the channel has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.

MigrateToChatId

The group has been migrated to a supergroup.

Fields of MigrateToChatId

data: Integer

Supergroup chat identifier.

MigrateFromChatId

The supergroup has been migrated from a group.

Fields of MigrateFromChatId

data: Integer

Group chat identifier.

PinnedMessage

Specified message was pinned.

Fields of PinnedMessage

data: Box<MessageOrChannelPost>

Trait Implementations

impl Clone for MessageKind[src]

impl Debug for MessageKind[src]

impl PartialEq<MessageKind> for MessageKind[src]

impl PartialOrd<MessageKind> for MessageKind[src]

impl StructuralPartialEq for MessageKind[src]

Auto Trait Implementations

impl RefUnwindSafe for MessageKind[src]

impl Send for MessageKind[src]

impl Sync for MessageKind[src]

impl Unpin for MessageKind[src]

impl UnwindSafe for MessageKind[src]

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.