Skip to main content

Message

Struct Message 

Source
#[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§author_signature: Option<String>§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>>§users_shared: Option<UsersShared>§chat_shared: Option<ChatShared>§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>§general_forum_topic_hidden: Option<GeneralForumTopicHidden>§general_forum_topic_unhidden: Option<GeneralForumTopicUnhidden>§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§

Trait Implementations§

Source§

impl Clone for Message

Source§

fn clone(&self) -> Message

Returns a duplicate 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 From<Message> for EditMessageResult

Source§

fn from(value: Message) -> Self

Converts to this type from the input type.
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

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> CallbackPayload for T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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