Struct telegram_types::bot::types::Message

source ·
pub struct Message {
Show 43 fields pub message_id: MessageId, pub from: Option<Box<User>>, pub sender_chat: Option<Chat>, pub date: Time, pub chat: Box<Chat>, pub forward_from: Option<Box<User>>, pub forward_from_chat: Option<Box<Chat>>, pub forward_from_message_id: Option<MessageId>, pub forward_signature: Option<String>, pub forward_sender_name: Option<String>, pub forward_date: Option<Time>, pub reply_to_message: Option<Box<Message>>, pub edit_date: Option<Time>, pub media_group_id: Option<String>, pub author_signature: Option<String>, pub text: Option<String>, pub sticker: Option<Box<Sticker>>, pub audio: Option<Audio>, pub document: Option<Box<Document>>, pub photo: Vec<PhotoSize>, pub entities: Vec<MessageEntity>, pub voice: Option<Box<Voice>>, pub video: Option<Video>, pub video_note: Option<Box<VideoNote>>, pub animation: Option<Box<Animation>>, pub caption_entities: Vec<MessageEntity>, pub caption: Option<String>, pub contact: Option<Box<Contact>>, pub location: Option<Box<Location>>, pub venue: Option<Box<Venue>>, pub new_chat_members: Vec<User>, pub left_chat_member: Option<Box<User>>, pub new_chat_title: Option<String>, pub new_chat_photo: Vec<PhotoSize>, pub delete_chat_photo: bool, pub group_chat_created: bool, pub supergroup_chat_created: bool, pub channel_chat_created: bool, pub migrate_to_chat_id: Option<ChatId>, pub migrate_from_chat_id: Option<ChatId>, pub pinned_message: Option<Box<Message>>, pub connected_website: Option<String>, pub reply_markup: Option<InlineKeyboardMarkup>,
}

Fields§

§message_id: MessageId

Unique message identifier inside this chat

§from: Option<Box<User>>

Sender, empty for messages sent to channels

§sender_chat: Option<Chat>

Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group

§date: Time

Date the message was sent in Unix time

§chat: Box<Chat>

Conversation the message belongs to

§forward_from: Option<Box<User>>

For forwarded messages, sender of the original message

§forward_from_chat: Option<Box<Chat>>

For messages forwarded from channels, information about the original channel

§forward_from_message_id: Option<MessageId>

For messages forwarded from channels, identifier of the original message in the channel

§forward_signature: Option<String>

For messages forwarded from channels, signature of the post author if present

§forward_sender_name: Option<String>

Sender’s name for messages forwarded from users who disallow adding a link to their account in forwarded messages

§forward_date: Option<Time>

For forwarded messages, date the original message was sent in Unix time

§reply_to_message: Option<Box<Message>>

For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

§edit_date: Option<Time>

Date the message was last edited in Unix time

§media_group_id: Option<String>

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

§author_signature: Option<String>

Signature of the post author for messages in channels

§text: Option<String>

For text messages, the actual UTF-8 text of the message, 0-4096 characters.

§sticker: Option<Box<Sticker>>

Message is a sticker, information about the sticker

§audio: Option<Audio>

Message is an audio file, information about the file

§document: Option<Box<Document>>

Message is a general file, information about the file

§photo: Vec<PhotoSize>§entities: Vec<MessageEntity>

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

§voice: Option<Box<Voice>>

Message is a voice message, information about the file

§video: Option<Video>

Message is a video, information about the video

§video_note: Option<Box<VideoNote>>

Message is a video note, information about the video message

§animation: Option<Box<Animation>>

Message is an animation, information about the animation.

For backward compatibility, when this field is set, the document field will also be set

§caption_entities: Vec<MessageEntity>

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

§caption: Option<String>

Caption for the audio, document, photo, video or voice, 0-200 characters

§contact: Option<Box<Contact>>

Message is a shared contact, information about the contact

§location: Option<Box<Location>>

Message is a shared location, information about the location

§venue: Option<Box<Venue>>

Message is a venue, information about the venue

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

§left_chat_member: Option<Box<User>>

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

§new_chat_title: Option<String>

A chat title was changed to this value

§new_chat_photo: Vec<PhotoSize>

A chat photo was change to this value

§delete_chat_photo: bool

Service message: the chat photo was deleted

§group_chat_created: bool

Service message: the group has been created

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

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

§migrate_to_chat_id: Option<ChatId>

The group has been migrated to a supergroup with the specified identifier.

§migrate_from_chat_id: Option<ChatId>

The supergroup has been migrated from a group with the specified identifier.

§pinned_message: Option<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.

§connected_website: Option<String>

The domain name of the website on which the user has logged in.

§reply_markup: Option<InlineKeyboardMarkup>

Inline keyboard attached to the message.

login_url buttons are represented as ordinary url buttons.

Trait Implementations§

source§

impl Clone for Message

source§

fn clone(&self) -> Message

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Message

source§

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

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

impl<'de> Deserialize<'de> for Message

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 Message

source§

fn eq(&self, other: &Message) -> 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 Message

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 Message

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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>,