pub struct Message {
Show 21 fields pub message_id: i32, pub from: Option<User>, pub sender_chat: Option<Chat>, pub date: i32, pub chat: Chat, pub forward_from: Option<User>, pub forward_from_chat: Option<Chat>, pub forward_from_message_id: Option<i32>, pub forward_signature: Option<String>, pub forward_sender_name: Option<String>, pub forward_date: Option<i32>, pub is_automatic_forward: bool, pub reply_to_message: Option<Box<Message>>, pub via_bot: Option<User>, pub edit_date: Option<i32>, pub has_protected_content: bool, pub media_group_id: Option<String>, pub author_signature: Option<String>, pub content: MessageContent, pub web_app_data: Option<WebAppData>, pub reply_markup: Option<InlineKeyboardMarkup>,
}
Expand description

This object represents a message.

Fields

message_id: i32

Unique message identifier inside this chat

from: Option<User>

Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

sender_chat: Option<Chat>

Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

date: i32

Date the message was sent in Unix time

chat: Chat

Conversation the message belongs to

forward_from: Option<User>

For forwarded messages, sender of the original message

forward_from_chat: Option<Chat>

For messages forwarded from channels or from anonymous administrators, information about the original sender chat

forward_from_message_id: Option<i32>

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

forward_signature: Option<String>

For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender 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<i32>

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

is_automatic_forward: bool

True, if the message is a channel post that was automatically forwarded to the connected discussion group

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.

via_bot: Option<User>

Bot through which the message was sent

edit_date: Option<i32>

Date the message was last edited in Unix time

has_protected_content: bool

True, if the message can’t be forwarded

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, or the custom title of an anonymous group administrator

content: MessageContent

The content of the message

web_app_data: Option<WebAppData>

Service message: data sent by a Web App

reply_markup: Option<InlineKeyboardMarkup>

Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

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.