#[non_exhaustive]pub struct Message {Show 110 fields
pub message_id: i64,
pub date: i64,
pub chat: Chat,
pub from_user: Option<User>,
pub sender_chat: Option<Chat>,
pub sender_boost_count: Option<i32>,
pub sender_business_bot: Option<User>,
pub business_connection_id: Option<String>,
pub message_thread_id: Option<i64>,
pub is_topic_message: bool,
pub forward_origin: Option<MessageOrigin>,
pub is_automatic_forward: bool,
pub reply_to_message: Option<Box<Message>>,
pub external_reply: Option<Box<ExternalReplyInfo>>,
pub quote: Option<TextQuote>,
pub reply_to_story: Option<Story>,
pub via_bot: Option<User>,
pub edit_date: Option<i64>,
pub has_protected_content: bool,
pub is_from_offline: bool,
pub is_paid_post: bool,
pub media_group_id: Option<String>,
pub author_signature: Option<String>,
pub sender_tag: Option<String>,
pub text: Option<String>,
pub entities: Option<Vec<MessageEntity>>,
pub link_preview_options: Option<LinkPreviewOptions>,
pub effect_id: Option<String>,
pub animation: Option<Animation>,
pub audio: Option<Audio>,
pub document: Option<Document>,
pub paid_media: Option<PaidMediaInfo>,
pub photo: Option<Vec<PhotoSize>>,
pub sticker: Option<Sticker>,
pub story: Option<Story>,
pub video: Option<Video>,
pub video_note: Option<VideoNote>,
pub voice: Option<Voice>,
pub caption: Option<String>,
pub caption_entities: Option<Vec<MessageEntity>>,
pub show_caption_above_media: bool,
pub has_media_spoiler: bool,
pub contact: Option<Contact>,
pub dice: Option<Dice>,
pub game: Option<Box<Game>>,
pub poll: Option<Box<Poll>>,
pub venue: Option<Box<Venue>>,
pub location: Option<Location>,
pub new_chat_members: Option<Vec<User>>,
pub left_chat_member: Option<User>,
pub new_chat_title: Option<String>,
pub new_chat_photo: Option<Vec<PhotoSize>>,
pub delete_chat_photo: bool,
pub group_chat_created: bool,
pub supergroup_chat_created: bool,
pub channel_chat_created: bool,
pub message_auto_delete_timer_changed: Option<MessageAutoDeleteTimerChanged>,
pub migrate_to_chat_id: Option<i64>,
pub migrate_from_chat_id: Option<i64>,
pub pinned_message: Option<Box<Message>>,
pub invoice: Option<Box<Invoice>>,
pub successful_payment: Option<Box<SuccessfulPayment>>,
pub refunded_payment: Option<Box<RefundedPayment>>,
pub paid_message_price_changed: Option<PaidMessagePriceChanged>,
pub paid_star_count: Option<i32>,
pub connected_website: Option<String>,
pub write_access_allowed: Option<WriteAccessAllowed>,
pub passport_data: Option<Box<PassportData>>,
pub proximity_alert_triggered: Option<ProximityAlertTriggered>,
pub boost_added: Option<ChatBoostAdded>,
pub chat_background_set: Option<ChatBackground>,
pub forum_topic_created: Option<ForumTopicCreated>,
pub forum_topic_edited: Option<ForumTopicEdited>,
pub forum_topic_closed: Option<ForumTopicClosed>,
pub forum_topic_reopened: Option<ForumTopicReopened>,
pub general_forum_topic_hidden: Option<GeneralForumTopicHidden>,
pub general_forum_topic_unhidden: Option<GeneralForumTopicUnhidden>,
pub giveaway_created: Option<GiveawayCreated>,
pub giveaway: Option<Box<Giveaway>>,
pub giveaway_winners: Option<Box<GiveawayWinners>>,
pub giveaway_completed: Option<Box<GiveawayCompleted>>,
pub video_chat_scheduled: Option<VideoChatScheduled>,
pub video_chat_started: Option<VideoChatStarted>,
pub video_chat_ended: Option<VideoChatEnded>,
pub video_chat_participants_invited: Option<VideoChatParticipantsInvited>,
pub web_app_data: Option<WebAppData>,
pub reply_markup: Option<InlineKeyboardMarkup>,
pub users_shared: Option<UsersShared>,
pub chat_shared: Option<ChatShared>,
pub gift: Option<GiftInfo>,
pub unique_gift: Option<UniqueGiftInfo>,
pub gift_upgrade_sent: Option<GiftInfo>,
pub checklist: Option<Checklist>,
pub checklist_tasks_done: Option<ChecklistTasksDone>,
pub checklist_tasks_added: Option<ChecklistTasksAdded>,
pub reply_to_checklist_task_id: Option<i64>,
pub direct_message_price_changed: Option<DirectMessagePriceChanged>,
pub direct_messages_topic: Option<DirectMessagesTopic>,
pub suggested_post_declined: Option<SuggestedPostDeclined>,
pub suggested_post_paid: Option<SuggestedPostPaid>,
pub suggested_post_refunded: Option<SuggestedPostRefunded>,
pub suggested_post_info: Option<SuggestedPostInfo>,
pub suggested_post_approved: Option<SuggestedPostApproved>,
pub suggested_post_approval_failed: Option<SuggestedPostApprovalFailed>,
pub chat_owner_changed: Option<ChatOwnerChanged>,
pub chat_owner_left: Option<ChatOwnerLeft>,
pub managed_bot_created: Option<ManagedBotCreated>,
pub poll_option_added: Option<PollOptionAdded>,
pub poll_option_deleted: Option<PollOptionDeleted>,
pub reply_to_poll_option_id: Option<String>,
}Expand description
This object represents a message.
Corresponds to the Bot API Message object.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message_id: i64Unique message identifier inside this chat.
date: i64Date the message was sent in Unix time.
chat: ChatConversation the message belongs to.
from_user: 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.
Renamed from Python’s from (reserved keyword).
sender_chat: Option<Chat>Sender of the message when sent on behalf of a chat.
sender_boost_count: Option<i32>If the sender of the message boosted the chat, the number of boosts added by the user.
sender_business_bot: Option<User>Bot through which the message was sent.
business_connection_id: Option<String>Unique identifier of the business connection from which the message was received.
message_thread_id: Option<i64>Unique identifier of a message thread to which the message belongs; for supergroups only.
is_topic_message: booltrue if the message is sent to a forum topic.
forward_origin: Option<MessageOrigin>Information about the original message for forwarded messages.
is_automatic_forward: booltrue if the message is a channel post that was automatically forwarded to the
connected discussion group.
reply_to_message: Option<Box<Message>>For replies in the same chat and message thread, the original message.
Note: The Message object in this field will not contain further reply_to_message
fields even if it itself is a reply.
external_reply: Option<Box<ExternalReplyInfo>>Information about the message that is being replied to, which may come from another chat or forum topic.
quote: Option<TextQuote>For replies that quote part of the original message, the quoted part of the message.
reply_to_story: Option<Story>For replies to a story, the original story.
via_bot: Option<User>Bot that originated the query if the message is a response to an inline query.
edit_date: Option<i64>Date the message was last edited in Unix time.
has_protected_content: booltrue if the message can’t be forwarded.
is_from_offline: booltrue if the message was sent by an implicit action, for example, as an away or a
greeting business message, or as a scheduled message.
is_paid_post: booltrue if the message is a paid post.
media_group_id: Option<String>The unique identifier of a media message group this message belongs to.
Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.
sender_tag: Option<String>Tag of the user who posted the message if it is anonymous.
text: Option<String>For text messages, the actual UTF-8 text of the message.
entities: Option<Vec<MessageEntity>>For text messages, special entities like usernames, URLs, bot commands etc. that appear in the text.
link_preview_options: Option<LinkPreviewOptions>Options used for link preview generation for the message, if it is a text message and link preview options were changed.
effect_id: Option<String>Unique identifier of the message effect added to the message.
animation: Option<Animation>Message is an animation, information about the animation.
audio: Option<Audio>Message is an audio file, information about the file.
document: Option<Document>Message is a general file, information about the file.
paid_media: Option<PaidMediaInfo>Message contains paid media; information about the paid media.
photo: Option<Vec<PhotoSize>>Message is a photo, available sizes of the photo.
sticker: Option<Sticker>Message is a sticker, information about the sticker.
story: Option<Story>Message is a forwarded story.
video: Option<Video>Message is a video, information about the video.
video_note: Option<VideoNote>Message is a video note, information about the video message.
voice: Option<Voice>Message is a voice message, information about the file.
caption: Option<String>Caption for the animation, audio, document, paid media, photo, video or voice.
caption_entities: Option<Vec<MessageEntity>>For messages with a caption, special entities like usernames, URLs, bot commands etc. that appear in the caption.
show_caption_above_media: booltrue if the caption must be shown above the message media.
has_media_spoiler: booltrue if the message media is covered by a spoiler animation.
contact: Option<Contact>Message is a shared contact, information about the contact.
dice: Option<Dice>Message is a dice with random value.
game: Option<Box<Game>>Message is a game, information about the game.
poll: Option<Box<Poll>>Message is a native poll, information about the poll.
venue: Option<Box<Venue>>Message is a venue, information about the venue.
location: Option<Location>Message is a shared location, information about the location.
new_chat_members: Option<Vec<User>>New members that were added to the group or supergroup.
left_chat_member: Option<User>A member was removed from the group.
new_chat_title: Option<String>A chat title was changed to this value.
new_chat_photo: Option<Vec<PhotoSize>>A chat photo was changed to this value.
delete_chat_photo: boolService message: the chat photo was deleted.
group_chat_created: boolService message: the group has been created.
supergroup_chat_created: boolService message: the supergroup has been created.
channel_chat_created: boolService message: the channel has been created.
message_auto_delete_timer_changed: Option<MessageAutoDeleteTimerChanged>Service message: auto-delete timer settings changed in the chat.
migrate_to_chat_id: Option<i64>The group has been migrated to a supergroup with the specified identifier.
migrate_from_chat_id: Option<i64>The supergroup has been migrated from a group with the specified identifier.
pinned_message: Option<Box<Message>>Specified message was pinned.
invoice: Option<Box<Invoice>>Message is an invoice for a payment, information about the invoice.
successful_payment: Option<Box<SuccessfulPayment>>Message is a service message about a successful payment.
refunded_payment: Option<Box<RefundedPayment>>Message is a service message about a refunded payment.
paid_message_price_changed: Option<PaidMessagePriceChanged>Message is a service message about the paid message price changing.
paid_star_count: Option<i32>The number of Telegram Stars that were paid by the sender of the message to send it.
connected_website: Option<String>Service message: the user is connected to a website via the connected website feature.
write_access_allowed: Option<WriteAccessAllowed>Write access was allowed.
passport_data: Option<Box<PassportData>>Telegram Passport data.
proximity_alert_triggered: Option<ProximityAlertTriggered>Service message: a user in the chat triggered another user’s proximity alert while sharing Live Location.
boost_added: Option<ChatBoostAdded>Service message: user boosted the chat.
chat_background_set: Option<ChatBackground>Service message: chat background set.
forum_topic_created: Option<ForumTopicCreated>Service message: forum topic created.
forum_topic_edited: Option<ForumTopicEdited>Service message: forum topic edited.
forum_topic_closed: Option<ForumTopicClosed>Service message: forum topic closed.
forum_topic_reopened: Option<ForumTopicReopened>Service message: forum topic reopened.
Service message: the General forum topic hidden.
Service message: the General forum topic unhidden.
giveaway_created: Option<GiveawayCreated>Service message: a scheduled giveaway was created.
giveaway: Option<Box<Giveaway>>The message is a scheduled giveaway message.
giveaway_winners: Option<Box<GiveawayWinners>>A giveaway with public winners was completed.
giveaway_completed: Option<Box<GiveawayCompleted>>Service message: a giveaway without public winners was completed.
video_chat_scheduled: Option<VideoChatScheduled>Service message: video chat scheduled.
video_chat_started: Option<VideoChatStarted>Service message: video chat started.
video_chat_ended: Option<VideoChatEnded>Service message: video chat ended.
video_chat_participants_invited: Option<VideoChatParticipantsInvited>Service message: new participants invited to a video chat.
web_app_data: Option<WebAppData>Service message: data sent by a Web App.
reply_markup: Option<InlineKeyboardMarkup>Inline keyboard attached to the message.
Service message: users were shared with the bot.
Service message: a chat was shared with the bot.
gift: Option<GiftInfo>Message is a gift.
unique_gift: Option<UniqueGiftInfo>A unique gift was sent or received.
gift_upgrade_sent: Option<GiftInfo>Service message: a gift was upgraded and the original gift was sent to the receiver.
checklist: Option<Checklist>Message contains a checklist.
checklist_tasks_done: Option<ChecklistTasksDone>Service message: checklist tasks were done.
checklist_tasks_added: Option<ChecklistTasksAdded>Service message: checklist tasks were added.
reply_to_checklist_task_id: Option<i64>Identifier of the checklist task the message is a reply to.
direct_message_price_changed: Option<DirectMessagePriceChanged>Service message: direct message price changed.
direct_messages_topic: Option<DirectMessagesTopic>Service message: the topic of a direct messages chat.
suggested_post_declined: Option<SuggestedPostDeclined>Service message: a suggested post was declined.
suggested_post_paid: Option<SuggestedPostPaid>Service message: a suggested post was paid.
suggested_post_refunded: Option<SuggestedPostRefunded>Service message: a suggested post was refunded.
suggested_post_info: Option<SuggestedPostInfo>Information about a suggested post in the channel.
suggested_post_approved: Option<SuggestedPostApproved>Service message: a suggested post was approved.
suggested_post_approval_failed: Option<SuggestedPostApprovalFailed>Service message: a suggested post approval failed.
chat_owner_changed: Option<ChatOwnerChanged>Service message: chat owner changed.
chat_owner_left: Option<ChatOwnerLeft>Service message: chat owner left.
managed_bot_created: Option<ManagedBotCreated>Service message: user created a bot that will be managed by the current bot.
Added in Bot API 9.6.
poll_option_added: Option<PollOptionAdded>Service message: answer option was added to a poll.
Added in Bot API 9.6.
poll_option_deleted: Option<PollOptionDeleted>Service message: answer option was deleted from a poll.
Added in Bot API 9.6.
reply_to_poll_option_id: Option<String>Persistent identifier of the poll option the message is a reply to.
Added in Bot API 9.6.