Message

Struct Message 

Source
pub struct Message {
Show 21 fields pub message_id: i32, pub from: Option<User>, pub sender_chat: Option<Chat>, pub date: i32, pub chat: Chat, pub forward_from: Option<User>, pub forward_from_chat: Option<Chat>, pub forward_from_message_id: Option<i32>, pub forward_signature: Option<String>, pub forward_sender_name: Option<String>, pub forward_date: Option<i32>, pub is_automatic_forward: bool, pub reply_to_message: Option<Box<Message>>, pub via_bot: Option<User>, pub edit_date: Option<i32>, pub has_protected_content: bool, pub media_group_id: Option<String>, pub author_signature: Option<String>, pub content: MessageContent, pub web_app_data: Option<WebAppData>, pub reply_markup: Option<InlineKeyboardMarkup>,
}
Expand description

This object represents a message.

Fields§

§message_id: i32

Unique message identifier inside this chat

§from: 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.

§sender_chat: Option<Chat>

Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

§date: i32

Date the message was sent in Unix time

§chat: Chat

Conversation the message belongs to

§forward_from: Option<User>

For forwarded messages, sender of the original message

§forward_from_chat: Option<Chat>

For messages forwarded from channels or from anonymous administrators, information about the original sender chat

§forward_from_message_id: Option<i32>

For messages forwarded from channels, identifier of the original message in the channel

§forward_signature: Option<String>

For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present

§forward_sender_name: Option<String>

Sender’s name for messages forwarded from users who disallow adding a link to their account in forwarded messages

§forward_date: Option<i32>

For forwarded messages, date the original message was sent in Unix time

§is_automatic_forward: bool

True, if the message is a channel post that was automatically forwarded to the connected discussion group

§reply_to_message: Option<Box<Message>>

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.

§via_bot: Option<User>

Bot through which the message was sent

§edit_date: Option<i32>

Date the message was last edited in Unix time

§has_protected_content: bool

True, if the message can’t be forwarded

§media_group_id: Option<String>

The unique identifier of a media message group this message belongs to

§author_signature: Option<String>

Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

§content: MessageContent

The content of the message

§web_app_data: Option<WebAppData>

Service message: data sent by a Web App

§reply_markup: Option<InlineKeyboardMarkup>

Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

Trait Implementations§

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