pub enum MessageKind {
Show 23 variants Text { data: String, entities: Vec<MessageEntity, Global>, }, Audio { data: Audio, }, Document { data: Document, caption: Option<String>, }, Photo { data: Vec<PhotoSize, Global>, 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, Global>, }, LeftChatMember { data: User, }, NewChatTitle { data: String, }, NewChatPhoto { data: Vec<PhotoSize, Global>, }, DeleteChatPhoto, GroupChatCreated, SupergroupChatCreated, ChannelChatCreated, MigrateToChatId { data: i64, }, MigrateFromChatId { data: i64, }, PinnedMessage { data: Box<MessageOrChannelPost, Global>, }, // some variants omitted
}
Expand description

Kind of the message.

Variants§

§

Text

Fields

§data: String

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

§entities: Vec<MessageEntity, Global>

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

Text message.

§

Audio

Fields

§data: Audio

Information about the file.

Message is an audio file.

§

Document

Fields

§data: Document

Information about the file.

§caption: Option<String>

Caption for the document, 0-200 characters.

Message is a general file.

§

Photo

Fields

§data: Vec<PhotoSize, Global>

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.

Message is a photo.

§

Sticker

Fields

§data: Sticker

Information about the sticker.

Message is a sticker.

§

Video

Fields

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

Message is a video.

§

Voice

Fields

§data: Voice

Information about the file.

Message is a voice message.

§

VideoNote

Fields

§data: VideoNote

Information about the file.

Message is a video note.

§

Contact

Fields

§data: Contact

Information about the contact.

Message is a shared contact.

§

Location

Fields

§data: Location

Information about the location.

Message is a shared location.

§

Poll

Fields

§data: Poll

Information about the poll.

Message is a poll.

§

Venue

Fields

§data: Venue

Information about the venue.

Message is a venue.

§

NewChatMembers

Fields

§data: Vec<User, Global>

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

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

§

LeftChatMember

Fields

§data: User

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

A member was removed from the group.

§

NewChatTitle

Fields

§data: String

A chat title was changed to this value.

New chat title.

§

NewChatPhoto

Fields

§data: Vec<PhotoSize, Global>

A chat photo was change to this value.

New chat photo.

§

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

Fields

§data: i64

Supergroup chat identifier.

The group has been migrated to a supergroup.

§

MigrateFromChatId

Fields

§data: i64

Group chat identifier.

The supergroup has been migrated from a group.

§

PinnedMessage

Specified message was pinned.

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
Obtain files from a message if available.
Obtain text from a message if available.
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
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. 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.

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.

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