pub struct Message {
    pub id: MessageId,
    pub from: User,
    pub date: i64,
    pub chat: MessageChat,
    pub forward: Option<Forward>,
    pub reply_to_message: Option<Box<MessageOrChannelPost, Global>>,
    pub edit_date: Option<i64>,
    pub kind: MessageKind,
}
Expand description

This object represents a chat message.

Fields§

§id: MessageId

Unique message identifier inside this chat.

§from: User

Sender, can be empty for messages sent to channels.

§date: i64

Date the message was sent in Unix time.

§chat: MessageChat

Conversation the message belongs to.

§forward: Option<Forward>

Information about the original message.

§reply_to_message: Option<Box<MessageOrChannelPost, Global>>

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.

§edit_date: Option<i64>

Date the message was last edited in Unix time.

§kind: MessageKind

Kind of the message.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.