[][src]Struct tgbot::types::Message

pub struct Message {
    pub id: Integer,
    pub date: Integer,
    pub kind: MessageKind,
    pub forward: Option<Forward>,
    pub reply_to: Option<Box<Message>>,
    pub edit_date: Option<Integer>,
    pub media_group_id: Option<String>,
    pub data: MessageData,
    pub commands: Option<Vec<BotCommand>>,
    pub reply_markup: Option<InlineKeyboardMarkup>,
}

This object represents a message

Fields

id: Integer

Unique message identifier inside this chat

date: Integer

Date the message was sent in Unix time

kind: MessageKind

Contains chat-specific data

forward: Option<Forward>

Forwarded data

reply_to: Option<Box<Message>>

For replies, the original message Note that the Message object in this field will not contain further reply_to 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

data: MessageData

Contains message data

commands: Option<Vec<BotCommand>>

Contains command data

reply_markup: Option<InlineKeyboardMarkup>

Inline keyboard attached to the message

Methods

impl Message[src]

pub fn is_edited(&self) -> bool[src]

Returns true if message has edited and false otherwise

pub fn get_chat_id(&self) -> Integer[src]

Returns ID of the chat

pub fn get_chat_username(&self) -> Option<&str>[src]

Returns username of the chat

pub fn get_user(&self) -> Option<&User>[src]

Returns author of the message

pub fn get_text(&self) -> Option<&Text>[src]

Returns text of the message (includes caption)

Trait Implementations

impl Clone for Message[src]

impl Debug for Message[src]

impl<'de> Deserialize<'de> for Message[src]

Auto Trait Implementations

impl RefUnwindSafe for Message

impl Send for Message

impl Sync for Message

impl Unpin for Message

impl UnwindSafe for Message

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.