#[non_exhaustive]pub struct Message {Show 98 fields
pub message_id: MessageId,
pub from: Option<User>,
pub sender_chat: Option<Chat>,
pub chat: Chat,
pub date: i64,
pub author_signature: Option<String>,
pub sender_tag: 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<MaybeInaccessibleMessage>>,
pub external_reply: Option<Box<ExternalReplyInfo>>,
pub quote: Option<TextQuote>,
pub reply_to_story: Option<Story>,
pub reply_to_checklist_task_id: Option<i64>,
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 paid_star_count: Option<u64>,
pub text: Option<String>,
pub caption: Option<String>,
pub entities: Option<Vec<MessageEntity>>,
pub caption_entities: Option<Vec<MessageEntity>>,
pub link_preview_options: Option<LinkPreviewOptions>,
pub suggested_post_info: Option<Box<SuggestedPostInfo>>,
pub effect_id: Option<String>,
pub animation: Option<Animation>,
pub audio: Option<Audio>,
pub contact: Option<Contact>,
pub dice: Option<Dice>,
pub document: Option<Document>,
pub paid_media: Option<Box<PaidMediaInfo>>,
pub location: Option<Location>,
pub photo: Option<Vec<PhotoSize>>,
pub sticker: Option<Sticker>,
pub story: Option<Story>,
pub venue: Option<Venue>,
pub video: Option<Video>,
pub video_note: Option<VideoNote>,
pub voice: Option<Voice>,
pub poll: Option<Box<Poll>>,
pub show_caption_above_media: bool,
pub has_media_spoiler: bool,
pub checklist: Option<Box<Checklist>>,
pub game: Option<Box<Game>>,
pub web_app_data: Option<WebAppData>,
pub write_access_allowed: Option<WriteAccessAllowed>,
pub new_chat_members: Option<Vec<User>>,
pub left_chat_member: Option<User>,
pub chat_owner_left: Option<ChatOwnerLeft>,
pub chat_owner_changed: Option<ChatOwnerChanged>,
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 pinned_message: Option<Box<MaybeInaccessibleMessage>>,
pub message_auto_delete_timer_changed: Option<MessageAutoDeleteTimerChanged>,
pub migrate_to_chat_id: Option<i64>,
pub migrate_from_chat_id: Option<i64>,
pub invoice: Option<Box<Invoice>>,
pub successful_payment: Option<Box<SuccessfulPayment>>,
pub refunded_payment: Option<Box<RefundedPayment>>,
pub users_shared: Option<UsersShared>,
pub chat_shared: Option<ChatShared>,
pub connected_website: Option<String>,
pub proximity_alert_triggered: Option<Box<ProximityAlertTriggered>>,
pub boost_added: Option<Box<ChatBoostAdded>>,
pub checklist_tasks_done: Option<Box<ChecklistTasksDone>>,
pub checklist_tasks_added: Option<Box<ChecklistTasksAdded>>,
pub direct_message_price_changed: Option<Box<DirectMessagePriceChanged>>,
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<Box<GiveawayCreated>>,
pub giveaway: Option<Box<Giveaway>>,
pub giveaway_winners: Option<Box<GiveawayWinners>>,
pub giveaway_completed: Option<Box<GiveawayCompleted>>,
pub paid_message_price_changed: Option<Box<PaidMessagePriceChanged>>,
pub suggested_post_approved: Option<Box<SuggestedPostApproved>>,
pub suggested_post_approval_failed: Option<Box<SuggestedPostApprovalFailed>>,
pub suggested_post_declined: Option<Box<SuggestedPostDeclined>>,
pub suggested_post_paid: Option<Box<SuggestedPostPaid>>,
pub suggested_post_refunded: Option<Box<SuggestedPostRefunded>>,
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 reply_markup: Option<Box<ReplyMarkup>>,
pub extra: BTreeMap<String, Value>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message_id: MessageId§from: Option<User>§sender_chat: Option<Chat>§chat: Chat§date: i64§sender_tag: Option<String>§message_thread_id: Option<i64>§is_topic_message: bool§forward_origin: Option<MessageOrigin>§is_automatic_forward: bool§reply_to_message: Option<Box<MaybeInaccessibleMessage>>§external_reply: Option<Box<ExternalReplyInfo>>§quote: Option<TextQuote>§reply_to_story: Option<Story>§reply_to_checklist_task_id: Option<i64>§via_bot: Option<User>§edit_date: Option<i64>§has_protected_content: bool§is_from_offline: bool§is_paid_post: bool§media_group_id: Option<String>§paid_star_count: Option<u64>§text: Option<String>§caption: Option<String>§entities: Option<Vec<MessageEntity>>§caption_entities: Option<Vec<MessageEntity>>§link_preview_options: Option<LinkPreviewOptions>§suggested_post_info: Option<Box<SuggestedPostInfo>>§effect_id: Option<String>§animation: Option<Animation>§audio: Option<Audio>§contact: Option<Contact>§dice: Option<Dice>§document: Option<Document>§paid_media: Option<Box<PaidMediaInfo>>§location: Option<Location>§photo: Option<Vec<PhotoSize>>§sticker: Option<Sticker>§story: Option<Story>§venue: Option<Venue>§video: Option<Video>§video_note: Option<VideoNote>§voice: Option<Voice>§poll: Option<Box<Poll>>§show_caption_above_media: bool§has_media_spoiler: bool§checklist: Option<Box<Checklist>>§game: Option<Box<Game>>§web_app_data: Option<WebAppData>§write_access_allowed: Option<WriteAccessAllowed>§new_chat_members: Option<Vec<User>>§left_chat_member: Option<User>§chat_owner_left: Option<ChatOwnerLeft>§chat_owner_changed: Option<ChatOwnerChanged>§new_chat_title: Option<String>§new_chat_photo: Option<Vec<PhotoSize>>§delete_chat_photo: bool§group_chat_created: bool§supergroup_chat_created: bool§channel_chat_created: bool§pinned_message: Option<Box<MaybeInaccessibleMessage>>§message_auto_delete_timer_changed: Option<MessageAutoDeleteTimerChanged>§migrate_to_chat_id: Option<i64>§migrate_from_chat_id: Option<i64>§invoice: Option<Box<Invoice>>§successful_payment: Option<Box<SuccessfulPayment>>§refunded_payment: Option<Box<RefundedPayment>>§connected_website: Option<String>§proximity_alert_triggered: Option<Box<ProximityAlertTriggered>>§boost_added: Option<Box<ChatBoostAdded>>§checklist_tasks_done: Option<Box<ChecklistTasksDone>>§checklist_tasks_added: Option<Box<ChecklistTasksAdded>>§direct_message_price_changed: Option<Box<DirectMessagePriceChanged>>§forum_topic_created: Option<ForumTopicCreated>§forum_topic_edited: Option<ForumTopicEdited>§forum_topic_closed: Option<ForumTopicClosed>§forum_topic_reopened: Option<ForumTopicReopened>§giveaway_created: Option<Box<GiveawayCreated>>§giveaway: Option<Box<Giveaway>>§giveaway_winners: Option<Box<GiveawayWinners>>§giveaway_completed: Option<Box<GiveawayCompleted>>§paid_message_price_changed: Option<Box<PaidMessagePriceChanged>>§suggested_post_approved: Option<Box<SuggestedPostApproved>>§suggested_post_approval_failed: Option<Box<SuggestedPostApprovalFailed>>§suggested_post_declined: Option<Box<SuggestedPostDeclined>>§suggested_post_paid: Option<Box<SuggestedPostPaid>>§suggested_post_refunded: Option<Box<SuggestedPostRefunded>>§video_chat_scheduled: Option<VideoChatScheduled>§video_chat_started: Option<VideoChatStarted>§video_chat_ended: Option<VideoChatEnded>§video_chat_participants_invited: Option<VideoChatParticipantsInvited>§reply_markup: Option<Box<ReplyMarkup>>§extra: BTreeMap<String, Value>Implementations§
Source§impl Message
impl Message
pub fn chat(&self) -> &Chat
pub fn from_user(&self) -> Option<&User>
pub fn sender_chat(&self) -> Option<&Chat>
pub fn reply_to_message(&self) -> Option<&MaybeInaccessibleMessage>
pub fn pinned_message(&self) -> Option<&MaybeInaccessibleMessage>
pub fn web_app_data(&self) -> Option<&WebAppData>
pub fn write_access_allowed(&self) -> Option<&WriteAccessAllowed>
pub fn forward_origin(&self) -> Option<&MessageOrigin>
pub fn is_automatic_forward(&self) -> bool
pub fn kind(&self) -> MessageKind
pub fn kinds(&self) -> Vec<MessageKind>
pub fn has_kind(&self, kind: MessageKind) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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 From<Message> for EditMessageResult
impl From<Message> for EditMessageResult
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more