RawMessage

Struct RawMessage 

Source
pub struct RawMessage {
Show 37 fields pub message_id: Integer, pub from: Option<User>, pub date: Integer, pub chat: Chat, pub forward_from: Option<User>, pub forward_from_chat: Option<Chat>, pub forward_from_message_id: Option<Integer>, pub forward_date: Option<Integer>, pub reply_to_message: Option<Box<MessageOrChannelPost>>, pub edit_date: Option<Integer>, pub media_group_id: Option<String>, pub text: Option<String>, pub entities: Option<Vec<MessageEntity>>, pub audio: Option<Audio>, pub document: Option<Document>, pub photo: Option<Vec<PhotoSize>>, pub sticker: Option<Sticker>, pub video: Option<Video>, pub voice: Option<Voice>, pub video_note: Option<VideoNote>, pub caption: Option<String>, pub contact: Option<Contact>, pub location: Option<Location>, pub poll: Option<Poll>, pub venue: Option<Venue>, pub new_chat_members: Option<Vec<User>>, pub left_chat_member: Option<User>, pub new_chat_title: Option<String>, pub new_chat_photo: Option<Vec<PhotoSize>>, pub delete_chat_photo: Option<True>, pub group_chat_created: Option<True>, pub supergroup_chat_created: Option<True>, pub channel_chat_created: Option<True>, pub migrate_to_chat_id: Option<Integer>, pub migrate_from_chat_id: Option<Integer>, pub pinned_message: Option<Box<MessageOrChannelPost>>, pub forward_sender_name: Option<String>,
}
Expand description

This object represents a message. Directly mapped.

Fields§

§message_id: Integer

Unique message identifier inside this chat.

§from: Option<User>

Sender, can be empty for messages sent to channels.

§date: Integer

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 a channel, information about the original channel.

§forward_from_message_id: Option<Integer>

For forwarded channel posts, identifier of the original message in the channel.

§forward_date: Option<Integer>

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

§reply_to_message: Option<Box<MessageOrChannelPost>>

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

Date the message was last edited in Unix time.

§media_group_id: Option<String>

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

§text: Option<String>

For text messages, the actual UTF-8 text of the message, 0-4096 characters.

§entities: Option<Vec<MessageEntity>>

For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.

§audio: Option<Audio>

Message is an audio file, information about the file.

§document: Option<Document>

Message is a general file, information about the file.

§photo: Option<Vec<PhotoSize>>

Message is a photo, available sizes of the photo.

§sticker: Option<Sticker>

Message is a sticker, information about the sticker.

§video: Option<Video>

Message is a video, information about the video.

§voice: Option<Voice>

Message is a voice message, information about the file.

§video_note: Option<VideoNote>

Message is a video note message, information about the file.

§caption: Option<String>

Caption for the document, photo or video, 0-200 characters.

§contact: Option<Contact>

Message is a shared contact, information about the contact.

§location: Option<Location>

Message is a shared location, information about the location.

§poll: Option<Poll>

Message is a native poll, information about the poll.

§venue: Option<Venue>

Message is a venue, information about the venue.

§new_chat_members: Option<Vec<User>>

New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

§left_chat_member: Option<User>

A member was removed from the group, information about them (this member may be the bot itself)

§new_chat_title: Option<String>

A chat title was changed to this value.

§new_chat_photo: Option<Vec<PhotoSize>>

A chat photo was change to this value.

§delete_chat_photo: Option<True>

Service message: the chat photo was deleted.

§group_chat_created: Option<True>

Service message: the group has been created.

§supergroup_chat_created: Option<True>

Service message: the supergroup has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.

§channel_chat_created: Option<True>

Service message: the channel has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.

§migrate_to_chat_id: Option<Integer>

The group has been migrated to a supergroup with the specified identifier.

§migrate_from_chat_id: Option<Integer>

The supergroup has been migrated from a group with the specified identifier.

§pinned_message: Option<Box<MessageOrChannelPost>>

Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.

§forward_sender_name: Option<String>

Forward from channel by a hidden user.

Trait Implementations§

Source§

impl Clone for RawMessage

Source§

fn clone(&self) -> RawMessage

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 RawMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RawMessage

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 RawMessage

Source§

fn eq(&self, other: &RawMessage) -> 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 PartialOrd for RawMessage

Source§

fn partial_cmp(&self, other: &RawMessage) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for RawMessage

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