Skip to main content

Message

Struct Message 

Source
pub struct Message {
Show 38 fields pub id: i64, pub sender_id: MessageSender, pub chat_id: i64, pub sending_state: Option<MessageSendingState>, pub scheduling_state: Option<MessageSchedulingState>, pub is_outgoing: bool, pub is_pinned: bool, pub is_from_offline: bool, pub can_be_saved: bool, pub has_timestamped_media: bool, pub is_channel_post: bool, pub is_paid_star_suggested_post: bool, pub is_paid_ton_suggested_post: bool, pub contains_unread_mention: bool, pub date: i32, pub edit_date: i32, pub forward_info: Option<MessageForwardInfo>, pub import_info: Option<MessageImportInfo>, pub interaction_info: Option<MessageInteractionInfo>, pub unread_reactions: Vec<UnreadReaction>, pub fact_check: Option<FactCheck>, pub suggested_post_info: Option<SuggestedPostInfo>, pub reply_to: Option<MessageReplyTo>, pub topic_id: Option<MessageTopic>, pub self_destruct_type: Option<MessageSelfDestructType>, pub self_destruct_in: f64, pub auto_delete_in: f64, pub via_bot_user_id: i64, pub sender_business_bot_user_id: i64, pub sender_boost_count: i32, pub paid_message_star_count: i64, pub author_signature: String, pub media_album_id: i64, pub effect_id: i64, pub restriction_info: Option<RestrictionInfo>, pub summary_language_code: String, pub content: MessageContent, pub reply_markup: Option<ReplyMarkup>,
}
Expand description

Describes a message

Fields§

§id: i64

Message identifier; unique for the chat to which the message belongs

§sender_id: MessageSender

Identifier of the sender of the message

§chat_id: i64

Chat identifier

§sending_state: Option<MessageSendingState>

The sending state of the message; may be null if the message isn’t being sent and didn’t fail to be sent

§scheduling_state: Option<MessageSchedulingState>

The scheduling state of the message; may be null if the message isn’t scheduled

§is_outgoing: bool

True, if the message is outgoing

§is_pinned: bool

True, if the message is pinned

§is_from_offline: bool

True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message

§can_be_saved: bool

True, if content of the message can be saved locally

§has_timestamped_media: bool

True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message

§is_channel_post: bool

True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts

§is_paid_star_suggested_post: bool

True, if the message is a suggested channel post which was paid in Telegram Stars; a warning must be shown if the message is deleted in less than getOption(“suggested_post_lifetime_min”) seconds after sending

§is_paid_ton_suggested_post: bool

True, if the message is a suggested channel post which was paid in Toncoins; a warning must be shown if the message is deleted in less than getOption(“suggested_post_lifetime_min”) seconds after sending

§contains_unread_mention: bool

True, if the message contains an unread mention for the current user

§date: i32

Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages

§edit_date: i32

Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages

§forward_info: Option<MessageForwardInfo>

Information about the initial message sender; may be null if none or unknown

§import_info: Option<MessageImportInfo>

Information about the initial message for messages created with importMessages; may be null if the message isn’t imported

§interaction_info: Option<MessageInteractionInfo>

Information about interactions with the message; may be null if none

§unread_reactions: Vec<UnreadReaction>

Information about unread reactions added to the message

§fact_check: Option<FactCheck>

Information about fact-check added to the message; may be null if none

§suggested_post_info: Option<SuggestedPostInfo>

Information about the suggested post; may be null if the message isn’t a suggested post

§reply_to: Option<MessageReplyTo>

Information about the message or the story this message is replying to; may be null if none

§topic_id: Option<MessageTopic>

Identifier of the topic within the chat to which the message belongs; may be null if none; may change when the chat is converted to a forum or back

§self_destruct_type: Option<MessageSelfDestructType>

The message’s self-destruct type; may be null if none

§self_destruct_in: f64

Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn’t scheduled yet

§auto_delete_in: f64

Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never

§via_bot_user_id: i64

If non-zero, the user identifier of the inline bot through which this message was sent

§sender_business_bot_user_id: i64

If non-zero, the user identifier of the business bot that sent this message

§sender_boost_count: i32

Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead

§paid_message_star_count: i64

The number of Telegram Stars the sender paid to send the message

§author_signature: String

For channel posts and anonymous group messages, optional author signature

§media_album_id: i64

Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums

§effect_id: i64

Unique identifier of the effect added to the message; 0 if none

§restriction_info: Option<RestrictionInfo>

Information about the restrictions that must be applied to the message content; may be null if none

§summary_language_code: String

IETF language tag of the message language on which it can be summarized; empty if summary isn’t available for the message

§content: MessageContent

Content of the message

§reply_markup: Option<ReplyMarkup>

Reply markup for the message; may be null if none

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

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

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,