pub struct Message {Show 22 fields
pub id: i64,
pub from_id: i64,
pub peer_id: Option<Peer>,
pub chat_id: i64,
pub message: Option<String>,
pub out: bool,
pub date: i64,
pub mentioned: Option<bool>,
pub reply_to_msg_id: Option<i64>,
pub media: Option<MessageMedia>,
pub edit_date: Option<i64>,
pub grouped_id: Option<i64>,
pub attachments: Option<MessageAttachments>,
pub reactions: Option<MessageReactions>,
pub is_sticker: Option<bool>,
pub has_link: Option<bool>,
pub entities: Option<MessageEntities>,
pub send_mode: Option<i32>,
pub fwd_from: Option<MessageFwdHeader>,
pub replies: Option<MessageReplies>,
pub actions: Option<MessageActions>,
pub rev: Option<i64>,
}Fields§
§id: i64§from_id: i64User ID of the sender
peer_id: Option<Peer>Peer ID of the recipient
chat_id: i64The “chat ID” of the message, for messages in a chat (deprecated)
message: Option<String>Message text
out: boolWhether the message is outgoing
date: i64Date of the message
mentioned: Option<bool>Whether user is mentioned
reply_to_msg_id: Option<i64>Message ID of the message being replied to
media: Option<MessageMedia>Media of the message
edit_date: Option<i64>Date of the last edit if edited
grouped_id: Option<i64>ID of the grouped message if it’s part of an album
attachments: Option<MessageAttachments>Attachments of the message
reactions: Option<MessageReactions>Reactions of the message
is_sticker: Option<bool>Whether the message is a sticker
has_link: Option<bool>§entities: Option<MessageEntities>Rich text entities
send_mode: Option<i32>Send mode for this message, if any
fwd_from: Option<MessageFwdHeader>Forward header info
replies: Option<MessageReplies>Replies shown under the parent message row when this message has an anchored child thread.
actions: Option<MessageActions>Optional interactive actions (bot messages only).
rev: Option<i64>Monotonic edit revision for the message. Increments on every edit.
Implementations§
Source§impl Message
impl Message
Sourcepub fn message(&self) -> &str
pub fn message(&self) -> &str
Returns the value of message, or the default value if message is unset.
Sourcepub fn mentioned(&self) -> bool
pub fn mentioned(&self) -> bool
Returns the value of mentioned, or the default value if mentioned is unset.
Sourcepub fn reply_to_msg_id(&self) -> i64
pub fn reply_to_msg_id(&self) -> i64
Returns the value of reply_to_msg_id, or the default value if reply_to_msg_id is unset.
Sourcepub fn edit_date(&self) -> i64
pub fn edit_date(&self) -> i64
Returns the value of edit_date, or the default value if edit_date is unset.
Sourcepub fn grouped_id(&self) -> i64
pub fn grouped_id(&self) -> i64
Returns the value of grouped_id, or the default value if grouped_id is unset.
Sourcepub fn is_sticker(&self) -> bool
pub fn is_sticker(&self) -> bool
Returns the value of is_sticker, or the default value if is_sticker is unset.
Sourcepub fn send_mode(&self) -> MessageSendMode
pub fn send_mode(&self) -> MessageSendMode
Returns the enum value of send_mode, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_send_mode(&mut self, value: MessageSendMode)
pub fn set_send_mode(&mut self, value: MessageSendMode)
Sets send_mode to the provided enum value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Message for Message
impl Message for Message
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.