MessageContent

Enum MessageContent 

Source
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: Sticker, }, Video { video: Video, caption: Option<Caption>, }, VideoNote { video_note: VideoNote, }, Voice { voice: Voice, caption: Option<Caption>, }, Contact { contact: Contact, }, Dice { dice: Dice, }, Game { game: Game, }, Poll { poll: Poll, }, Venue { venue: Venue, location: 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: True, }, GroupChatCreated { group_chat_created: True, }, SupergroupChatCreated { supergroup_chat_created: True, }, ChannelChatCreated { channel_chat_created: True, }, 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 { video_chat_scheduled: VideoChatScheduled, }, VideoChatStarted { video_chat_started: VideoChatStarted, }, VideoChatEnded { video_chat_ended: VideoChatEnded, }, VideoChatParticipantsInvited { video_chat_participants_invited: VideoChatParticipantsInvited, },
}
Expand description

The object representing message content

Variants§

§

Text

Message is a text message

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

§

Animation

Message is an 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

§

Audio

Message is an audio file

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

§

Document

Message is a general file

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

§

Photo

Message is a 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

§

Sticker

Message is a sticker

Fields

§sticker: Sticker
§

Video

Message is a 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

§

VideoNote

Message is a video note

Fields

§video_note: VideoNote
§

Voice

Message is a voice message

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

§

Contact

Message is a shared contact

Fields

§contact: Contact
§

Dice

Message is a dice with random value

Fields

§dice: Dice
§

Game

Message is a game. More about games »

Fields

§game: Game
§

Poll

Message is a native poll

Fields

§poll: Poll
§

Venue

Message is a 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

§

Location

Message is a shared location

Fields

§location: 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

Service message: the chat photo was deleted

Fields

§delete_chat_photo: True

Service message: the chat photo was deleted

§

GroupChatCreated

Service message: the group has been created

Fields

§group_chat_created: True

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.

Fields

§supergroup_chat_created: True

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.

Fields

§channel_chat_created: True

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

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

Fields

§message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged

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

§

MigrateToChatId

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.

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

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.

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

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.

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

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

Fields

§invoice: Invoice

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

§

SuccessfulPayment

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

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

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

Fields

§proximity_alert_triggered: ProximityAlertTriggered

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

§

VideoChatScheduled

Service message: video chat scheduled

Fields

§video_chat_scheduled: VideoChatScheduled

Service message: video chat scheduled

§

VideoChatStarted

Service message: video chat started

Fields

§video_chat_started: VideoChatStarted

Service message: video chat started

§

VideoChatEnded

Service message: video chat ended

Fields

§video_chat_ended: VideoChatEnded

Service message: video chat ended

§

VideoChatParticipantsInvited

Service message: new participants invited to a video chat

Fields

§video_chat_participants_invited: VideoChatParticipantsInvited

Service message: new participants invited to a video chat

Trait Implementations§

Source§

impl Debug for MessageContent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MessageContent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MessageContent

Source§

fn eq(&self, other: &MessageContent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MessageContent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MessageContent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,