pub enum MessageContent {
Show 35 variants Text { text: String, entities: Vec<MessageEntity>, }, Animation { animation: Animation, document: Document, caption: Option<Caption>, }, Audio { audio: Audio, caption: Option<Caption>, }, Document { document: Document, caption: Option<Caption>, }, Photo { photo: Vec<PhotoSize>, caption: Option<Caption>, }, Sticker(Sticker), Video { video: Video, caption: Option<Caption>, }, VideoNote(VideoNote), Voice { voice: Voice, caption: Option<Caption>, }, Contact(Contact), Dice(Dice), Game(Game), Poll(Poll), Venue { venue: Venue, location: Location, }, Location(Location), NewChatMembers { new_chat_members: Vec<User>, }, LeftChatMember { left_chat_member: User, }, NewChatTitle { new_chat_title: String, }, NewChatPhoto { new_chat_photo: Vec<PhotoSize>, }, DeleteChatPhoto { delete_chat_photo: bool, }, GroupChatCreated { group_chat_created: bool, }, SupergroupChatCreated { supergroup_chat_created: bool, }, ChannelChatCreated { channel_chat_created: bool, }, MessageAutoDeleteTimerChanged { message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged, }, MigrateToChatId { migrate_to_chat_id: i64, }, MigrateFromChatId { migrate_from_chat_id: i64, }, PinnedMessage { pinned_message: Box<Message>, }, Invoice { invoice: Invoice, }, SuccessfulPayment { successful_payment: SuccessfulPayment, }, Login { connected_website: String, passport_data: PassportData, }, ProximityAlertTriggered { proximity_alert_triggered: ProximityAlertTriggered, }, VideoChatScheduled(VideoChatScheduled), VideoChatStarted(VideoChatStarted), VideoChatEnded(VideoChatEnded), VideoChatParticipantsInvited(VideoChatParticipantsInvited),
}
Expand description

The object representing message content

Variants

Text

Fields

text: String

For text messages, the actual UTF-8 text of the message

entities: Vec<MessageEntity>

For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

Message is a text message

Animation

Fields

animation: Animation

Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set

document: Document

Message is a general file, information about the file

caption: Option<Caption>

Caption for the animation, audio, document, photo, video or voice

Message is an animation

Audio

Fields

audio: Audio

Message is an audio file, information about the file

caption: Option<Caption>

Caption for the animation, audio, document, photo, video or voice

Message is an audio file

Document

Fields

document: Document

Message is a general file, information about the file

caption: Option<Caption>

Caption for the animation, audio, document, photo, video or voice

Message is a general file

Photo

Fields

photo: Vec<PhotoSize>

Message is a photo, available sizes of the photo

caption: Option<Caption>

Caption for the animation, audio, document, photo, video or voice

Message is a photo

Sticker(Sticker)

Message is a sticker

Video

Fields

video: Video

Message is a video, information about the video

caption: Option<Caption>

Caption for the animation, audio, document, photo, video or voice

Message is a video

VideoNote(VideoNote)

Message is a video note

Voice

Fields

voice: Voice

Message is a voice message, information about the file

caption: Option<Caption>

Caption for the animation, audio, document, photo, video or voice

Message is a voice message

Contact(Contact)

Message is a shared contact

Dice(Dice)

Message is a dice with random value

Game(Game)

Message is a game. More about games »

Poll(Poll)

Message is a native poll

Venue

Fields

venue: Venue

Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set

location: Location

information about the location

Message is a venue.

Location(Location)

Message is a shared location

NewChatMembers

Fields

new_chat_members: Vec<User>

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

left_chat_member: User

A member was removed from the group, information about them (this member may be the bot itself)

NewChatTitle

Fields

new_chat_title: String

A chat title was changed to this value

NewChatPhoto

Fields

new_chat_photo: Vec<PhotoSize>

A chat photo was change to this value

DeleteChatPhoto

Fields

delete_chat_photo: bool

Service message: the chat photo was deleted

GroupChatCreated

Fields

group_chat_created: bool

Service message: the group has been created

SupergroupChatCreated

Fields

supergroup_chat_created: bool

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

Fields

channel_chat_created: bool

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.

MessageAutoDeleteTimerChanged

Fields

message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged

Service message: auto-delete timer settings changed in the chat

MigrateToChatId

Fields

migrate_to_chat_id: i64

The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

MigrateFromChatId

Fields

migrate_from_chat_id: i64

The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

PinnedMessage

Fields

pinned_message: Box<Message>

Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.

Invoice

Fields

invoice: Invoice

Message is an invoice for a payment, information about the invoice. More about payments »

SuccessfulPayment

Fields

successful_payment: SuccessfulPayment

Message is a service message about a successful payment, information about the payment. More about payments »

Login

Fields

connected_website: String

The domain name of the website on which the user has logged in. More about Telegram Login »

passport_data: PassportData

Telegram Passport data

ProximityAlertTriggered

Fields

proximity_alert_triggered: ProximityAlertTriggered

Service message. A user in the chat triggered another user’s proximity alert while sharing Live Location.

VideoChatScheduled(VideoChatScheduled)

Service message: video chat scheduled

VideoChatStarted(VideoChatStarted)

Service message: video chat started

VideoChatEnded(VideoChatEnded)

Service message: video chat ended

VideoChatParticipantsInvited(VideoChatParticipantsInvited)

Service message: new participants invited to a video chat

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. 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 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.