Skip to main content

Message

Struct Message 

Source
pub struct Message {
    pub id: MessageId,
    pub thread_id: Option<ThreadId>,
    pub from: Option<User>,
    pub sender_chat: Option<Chat>,
    pub date: DateTime<Utc>,
    pub chat: Chat,
    pub is_topic_message: bool,
    pub via_bot: Option<User>,
    pub sender_business_bot: Option<User>,
    pub kind: MessageKind,
}
Expand description

This object represents a message.

The official docs.

Fields§

§id: MessageId

Unique message identifier inside this chat.

§thread_id: Option<ThreadId>

Unique identifier of a message thread to which the message belongs; for supergroups only.

§from: Option<User>

Sender, empty for messages sent to channels.

§sender_chat: Option<Chat>

Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group

§date: DateTime<Utc>

Date the message was sent in Unix time.

§chat: Chat

Conversation the message belongs to.

§is_topic_message: bool

true, if the message is sent to a forum topic.

§via_bot: Option<User>

Bot through which the message was sent.

§sender_business_bot: Option<User>

The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.

§kind: MessageKind

Implementations§

Source§

impl Message

Getters for Message fields from telegram docs.

Source

pub fn from(&self) -> Option<&User>

👎Deprecated since 0.13.0: use .from field instead

Returns the user who sent the message.

Source

pub fn author_signature(&self) -> Option<&str>

Source

pub fn effect_id(&self) -> Option<&EffectId>

Source

pub fn sender_chat(&self) -> Option<&Chat>

👎Deprecated since 0.13.0: use .sender_chat field instead
Source

pub fn forward_origin(&self) -> Option<&MessageOrigin>

Source

pub fn quote(&self) -> Option<&TextQuote>

Source

pub fn reply_to_story(&self) -> Option<&Story>

Source

pub fn sender_boost_count(&self) -> Option<u16>

Source

pub fn forward_date(&self) -> Option<DateTime<Utc>>

Source

pub fn forward_from_user(&self) -> Option<&User>

Source

pub fn forward_from_chat(&self) -> Option<&Chat>

Source

pub fn forward_from_sender_name(&self) -> Option<&str>

Source

pub fn forward_from_message_id(&self) -> Option<MessageId>

Source

pub fn forward_author_signature(&self) -> Option<&str>

Source

pub fn reply_to_message(&self) -> Option<&Message>

Examples found in repository?
examples/admin.rs (line 79)
78async fn kick_user(bot: Bot, msg: Message) -> ResponseResult<()> {
79    match msg.reply_to_message() {
80        Some(replied) => {
81            // bot.unban_chat_member can also kicks a user from a group chat.
82            bot.unban_chat_member(msg.chat.id, replied.from.as_ref().unwrap().id).await?;
83        }
84        None => {
85            bot.send_message(msg.chat.id, "Use this command in reply to another message").await?;
86        }
87    }
88    Ok(())
89}
90
91// Ban a user with replied message.
92async fn ban_user(bot: Bot, msg: Message, time: Duration) -> ResponseResult<()> {
93    match msg.reply_to_message() {
94        Some(replied) => {
95            bot.kick_chat_member(
96                msg.chat.id,
97                replied.from.as_ref().expect("Must be MessageKind::Common").id,
98            )
99            .until_date(msg.date + time)
100            .await?;
101        }
102        None => {
103            bot.send_message(msg.chat.id, "Use this command in a reply to another message!")
104                .await?;
105        }
106    }
107    Ok(())
108}
109
110// Mute a user with a replied message.
111async fn mute_user(bot: Bot, msg: Message, time: Duration) -> ResponseResult<()> {
112    match msg.reply_to_message() {
113        Some(replied) => {
114            bot.restrict_chat_member(
115                msg.chat.id,
116                replied.from.as_ref().expect("Must be MessageKind::Common").id,
117                ChatPermissions::empty(),
118            )
119            .until_date(msg.date + time)
120            .await?;
121        }
122        None => {
123            bot.send_message(msg.chat.id, "Use this command in a reply to another message!")
124                .await?;
125        }
126    }
127    Ok(())
128}
Source

pub fn edit_date(&self) -> Option<&DateTime<Utc>>

Source

pub fn media_group_id(&self) -> Option<&MediaGroupId>

Source

pub fn text(&self) -> Option<&str>

Examples found in repository?
examples/dialogue.rs (line 67)
66async fn receive_full_name(bot: Bot, dialogue: MyDialogue, msg: Message) -> HandlerResult {
67    match msg.text() {
68        Some(text) => {
69            bot.send_message(msg.chat.id, "How old are you?").await?;
70            dialogue.update(State::ReceiveAge { full_name: text.into() }).await?;
71        }
72        None => {
73            bot.send_message(msg.chat.id, "Send me plain text.").await?;
74        }
75    }
76
77    Ok(())
78}
79
80async fn receive_age(
81    bot: Bot,
82    dialogue: MyDialogue,
83    full_name: String, // Available from `State::ReceiveAge`.
84    msg: Message,
85) -> HandlerResult {
86    match msg.text().map(|text| text.parse::<u8>()) {
87        Some(Ok(age)) => {
88            bot.send_message(msg.chat.id, "What's your location?").await?;
89            dialogue.update(State::ReceiveLocation { full_name, age }).await?;
90        }
91        _ => {
92            bot.send_message(msg.chat.id, "Send me a number.").await?;
93        }
94    }
95
96    Ok(())
97}
98
99async fn receive_location(
100    bot: Bot,
101    dialogue: MyDialogue,
102    (full_name, age): (String, u8), // Available from `State::ReceiveLocation`.
103    msg: Message,
104) -> HandlerResult {
105    match msg.text() {
106        Some(location) => {
107            let report = format!("Full name: {full_name}\nAge: {age}\nLocation: {location}");
108            bot.send_message(msg.chat.id, report).await?;
109            dialogue.exit().await?;
110        }
111        None => {
112            bot.send_message(msg.chat.id, "Send me plain text.").await?;
113        }
114    }
115
116    Ok(())
117}
More examples
Hide additional examples
examples/db_remember.rs (line 65)
64async fn start(bot: Bot, dialogue: MyDialogue, msg: Message) -> HandlerResult {
65    match msg.text().map(|text| text.parse::<i32>()) {
66        Some(Ok(n)) => {
67            dialogue.update(State::GotNumber(n)).await?;
68            bot.send_message(
69                msg.chat.id,
70                format!("Remembered number {n}. Now use /get or /reset."),
71            )
72            .await?;
73        }
74        _ => {
75            bot.send_message(msg.chat.id, "Please, send me a number.").await?;
76        }
77    }
78
79    Ok(())
80}
examples/purchase.rs (line 111)
110async fn receive_full_name(bot: Bot, dialogue: MyDialogue, msg: Message) -> HandlerResult {
111    match msg.text().map(ToOwned::to_owned) {
112        Some(full_name) => {
113            let products = ["Apple", "Banana", "Orange", "Potato"]
114                .map(|product| InlineKeyboardButton::callback(product, product));
115
116            bot.send_message(msg.chat.id, "Select a product:")
117                .reply_markup(InlineKeyboardMarkup::new([products]))
118                .await?;
119            dialogue.update(State::ReceiveProductChoice { full_name }).await?;
120        }
121        None => {
122            bot.send_message(msg.chat.id, "Please, send me your full name.").await?;
123        }
124    }
125
126    Ok(())
127}
examples/buttons.rs (line 68)
63async fn message_handler(
64    bot: Bot,
65    msg: Message,
66    me: Me,
67) -> Result<(), Box<dyn Error + Send + Sync>> {
68    if let Some(text) = msg.text() {
69        match BotCommands::parse(text, me.username()) {
70            Ok(Command::Help) => {
71                // Just send the description of all commands.
72                bot.send_message(msg.chat.id, Command::descriptions().to_string()).await?;
73            }
74            Ok(Command::Start) => {
75                // Create a list of buttons and send them.
76                let keyboard = make_keyboard();
77                bot.send_message(msg.chat.id, "Debian versions:").reply_markup(keyboard).await?;
78            }
79
80            Err(_) => {
81                bot.send_message(msg.chat.id, "Command not found!").await?;
82            }
83        }
84    }
85
86    Ok(())
87}
examples/deep_linking.rs (line 108)
101pub async fn send_message(
102    bot: Bot,
103    id: ChatId, // Available from `State::WriteToSomeone`
104    msg: Message,
105    dialogue: MyDialogue,
106    me: Me,
107) -> HandlerResult {
108    match msg.text() {
109        Some(text) => {
110            // Trying to send a message to the user
111            let sent_result = bot
112                .send_message(id, format!("You have a new message!\n\n<i>{text}</i>"))
113                .parse_mode(ParseMode::Html)
114                .await;
115
116            // And if no error is returned, success!
117            if sent_result.is_ok() {
118                bot.send_message(
119                    msg.chat.id,
120                    format!(
121                        "Message sent!\n\nYour link is: {}?start={}",
122                        me.tme_url(),
123                        msg.chat.id
124                    ),
125                )
126                .await?;
127            } else {
128                bot.send_message(msg.chat.id, "Error sending message! Maybe user blocked the bot?")
129                    .await?;
130            }
131            dialogue.exit().await?;
132        }
133        None => {
134            bot.send_message(msg.chat.id, "This bot can send only text.").await?;
135        }
136    };
137    Ok(())
138}
Source

pub fn entities(&self) -> Option<&[MessageEntity]>

Returns message entities that represent text formatting.

Note: you probably want to use parse_entities instead.

This function returns Some(entities) for text messages and None for all other kinds of messages (including photos with captions).

See also: caption_entities.

Source

pub fn caption_entities(&self) -> Option<&[MessageEntity]>

Returns message entities that represent text formatting.

Note: you probably want to use parse_caption_entities instead.

This function returns Some(entities) for media messages and None for all other kinds of messages (including text messages).

See also: entities.

Source

pub fn show_caption_above_media(&self) -> bool

Returns true if the caption must be shown above the message media.

Getter for MediaPhoto::show_caption_above_media, MediaVideo::show_caption_above_media and MediaAnimation::show_caption_above_media.

Source

pub fn has_media_spoiler(&self) -> bool

Returns true if the message media is covered by a spoiler animation.

Getter for MediaPhoto::has_media_spoiler, MediaVideo::has_media_spoiler and MediaAnimation::has_media_spoiler.

Source

pub fn audio(&self) -> Option<&Audio>

Source

pub fn document(&self) -> Option<&Document>

Source

pub fn paid_media(&self) -> Option<&PaidMediaInfo>

Source

pub fn animation(&self) -> Option<&Animation>

Source

pub fn game(&self) -> Option<&Game>

Source

pub fn photo(&self) -> Option<&[PhotoSize]>

Source

pub fn sticker(&self) -> Option<&Sticker>

Source

pub fn story(&self) -> Option<&Story>

Source

pub fn video(&self) -> Option<&Video>

Source

pub fn voice(&self) -> Option<&Voice>

Source

pub fn video_note(&self) -> Option<&VideoNote>

Source

pub fn caption(&self) -> Option<&str>

Source

pub fn contact(&self) -> Option<&Contact>

Source

pub fn location(&self) -> Option<&Location>

Source

pub fn venue(&self) -> Option<&Venue>

Source

pub fn poll(&self) -> Option<&Poll>

Source

pub fn checklist(&self) -> Option<&Checklist>

Source

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

Source

pub fn left_chat_member(&self) -> Option<&User>

Source

pub fn new_chat_title(&self) -> Option<&str>

Source

pub fn new_chat_photo(&self) -> Option<&[PhotoSize]>

Source

pub fn is_delete_chat_photo(&self) -> bool

Returns true if the incoming Message contains the delete_chat_photo Service message.

More on this

Source

pub fn delete_chat_photo(&self) -> Option<&MessageDeleteChatPhoto>

Source

pub fn is_group_chat_created(&self) -> bool

Returns true if the incoming Message contains the group_chat_created Service message.

More on this

Source

pub fn group_chat_created(&self) -> Option<&MessageGroupChatCreated>

Source

pub fn is_super_group_chat_created(&self) -> bool

Returns true if the incoming Message contains the supergroup_chat_created Service message.

More on this

Source

pub fn super_group_chat_created(&self) -> Option<&MessageSupergroupChatCreated>

Source

pub fn is_channel_chat_created(&self) -> bool

Returns true if the incoming Message contains the channel_chat_created Service message.

More on this

Source

pub fn channel_chat_created(&self) -> Option<&MessageChannelChatCreated>

Source

pub fn message_auto_delete_timer_changed( &self, ) -> Option<&MessageAutoDeleteTimerChanged>

Source

pub fn chat_migration(&self) -> Option<&ChatMigration>

Source

pub fn migrate_to_chat_id(&self) -> Option<&ChatId>

Source

pub fn migrate_from_chat_id(&self) -> Option<&ChatId>

Source

pub fn pinned_message(&self) -> Option<&MaybeInaccessibleMessage>

Source

pub fn invoice(&self) -> Option<&Invoice>

Source

pub fn successful_payment(&self) -> Option<&SuccessfulPayment>

Source

pub fn connected_website(&self) -> Option<&str>

Source

pub fn write_access_allowed(&self) -> Option<&WriteAccessAllowed>

Source

pub fn passport_data(&self) -> Option<&PassportData>

Source

pub fn shared_chat(&self) -> Option<&ChatShared>

Source

pub fn shared_users(&self) -> Option<&UsersShared>

Source

pub fn dice(&self) -> Option<&Dice>

Source

pub fn proximity_alert_triggered(&self) -> Option<&ProximityAlertTriggered>

Source

pub fn boost_added(&self) -> Option<&ChatBoostAdded>

Source

pub fn chat_background_set(&self) -> Option<&ChatBackground>

Source

pub fn checklist_tasks_done(&self) -> Option<&ChecklistTasksDone>

Source

pub fn checklist_tasks_added(&self) -> Option<&ChecklistTasksAdded>

Source

pub fn direct_message_price_changed(&self) -> Option<&DirectMessagePriceChanged>

Source

pub fn forum_topic_created(&self) -> Option<&ForumTopicCreated>

Source

pub fn forum_topic_edited(&self) -> Option<&ForumTopicEdited>

Source

pub fn forum_topic_closed(&self) -> Option<&ForumTopicClosed>

Source

pub fn forum_topic_reopened(&self) -> Option<&ForumTopicReopened>

Source

pub fn general_forum_topic_hidden(&self) -> Option<&GeneralForumTopicHidden>

Source

pub fn general_forum_topic_unhidden(&self) -> Option<&GeneralForumTopicUnhidden>

Source

pub fn giveaway(&self) -> Option<&Giveaway>

Source

pub fn giveaway_completed(&self) -> Option<&GiveawayCompleted>

Source

pub fn giveaway_created(&self) -> Option<&GiveawayCreated>

Source

pub fn giveaway_winners(&self) -> Option<&GiveawayWinners>

Source

pub fn paid_message_price_changed(&self) -> Option<&PaidMessagePriceChanged>

Source

pub fn gift_info(&self) -> Option<&GiftInfo>

Source

pub fn unique_gift_info(&self) -> Option<&UniqueGiftInfo>

Source

pub fn gift_upgrade_sent(&self) -> Option<&GiftInfo>

Source

pub fn video_chat_scheduled(&self) -> Option<&VideoChatScheduled>

Source

pub fn video_chat_started(&self) -> Option<&VideoChatStarted>

Source

pub fn video_chat_ended(&self) -> Option<&VideoChatEnded>

Source

pub fn video_chat_participants_invited( &self, ) -> Option<&VideoChatParticipantsInvited>

Source

pub fn web_app_data(&self) -> Option<&WebAppData>

Source

pub fn reply_markup(&self) -> Option<&InlineKeyboardMarkup>

Source

pub fn is_automatic_forward(&self) -> bool

Source

pub fn has_protected_content(&self) -> bool

Source§

impl Message

Source

pub fn url(&self) -> Option<Url>

Produces a direct link to this message.

Note that for private groups the link will only be accessible for group members.

Returns None for private chats (i.e.: DMs) and private groups (not supergroups).

Source

pub fn url_of( chat_id: ChatId, chat_username: Option<&str>, message_id: MessageId, ) -> Option<Url>

Produces a direct link to a message in a chat.

If you have a Message object, use url instead. This function should only be used if you have limited information about the message (chat id, username of the chat, if any and its id).

Note that for private groups the link will only be accessible for group members.

Returns None for private chats (i.e.: DMs) and private groups (not supergroups).

Source

pub fn comment_url(&self, comment_id: MessageId) -> Option<Url>

Produces a direct link to a comment on this post.

Note that for private channels the link will only be accessible for channel members.

Returns None for private chats (i.e.: DMs) and private groups (not supergroups).

Source

pub fn comment_url_of( channel_id: ChatId, channel_username: Option<&str>, post_id: MessageId, comment_id: MessageId, ) -> Option<Url>

Produces a direct link to a comment on a post.

If you have a Message object of the channel post, use comment_url instead. This function should only be used if you have limited information about the message (channel id, username of the channel, if any, post id and comment id).

Note that for private channels the link will only be accessible for channel members.

Returns None for private chats (i.e.: DMs) and private groups (not supergroups).

Source

pub fn url_in_thread(&self, thread_starter_msg_id: MessageId) -> Option<Url>

Produces a direct link to this message in a given thread.

“Thread” is a group of messages that reply to each other in a tree-like structure. thread_starter_msg_id is the id of the first message in the thread, the root of the tree.

Note that for private groups the link will only be accessible for group members.

Returns None for private chats (i.e.: DMs) and private groups (not supergroups).

Source

pub fn url_in_thread_of( chat_id: ChatId, chat_username: Option<&str>, thread_starter_msg_id: MessageId, message_id: MessageId, ) -> Option<Url>

Produces a direct link to a message in a given thread.

If you have a Message object of the channel post, use url_in_thread instead. This function should only be used if you have limited information about the message (chat id, username of the chat, if any, thread starter id and message id).

“Thread” is a group of messages that reply to each other in a tree-like structure. thread_starter_msg_id is the id of the first message in the thread, the root of the tree.

Note that for private groups the link will only be accessible for group members.

Returns None for private chats (i.e.: DMs) and private groups (not supergroups).

Source

pub fn parse_entities(&self) -> Option<Vec<MessageEntityRef<'_>>>

Returns message entities that represent text formatting.

This function returns Some(entities) for text messages and None for all other kinds of messages (including photos with captions).

See also: parse_caption_entities.

Source

pub fn parse_caption_entities(&self) -> Option<Vec<MessageEntityRef<'_>>>

Returns message entities that represent text formatting.

This function returns Some(entities) for media messages and None for all other kinds of messages (including text messages).

See also: parse_entities.

Source

pub fn mentioned_users(&self) -> impl Iterator<Item = &User>

Returns all users that are “contained” in this Message structure.

This might be useful to track information about users.

Note that this function may return quite a few users as it scans replies, message entities and more. Also note that this function can return duplicate users.

In earlier versions of the teloixde-core, this function returned mentioned users in chat from which the Message was forwarded. E.g. from pinned messages in the chat. This functionality was lost with the TBA 7.3 update.

Trait Implementations§

Source§

impl Clone for Message

Source§

fn clone(&self) -> Message

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 Message

Source§

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

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

impl<'de> Deserialize<'de> for Message

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Message, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&Message> for MessageId

Source§

fn from(message: &Message) -> MessageId

Converts to this type from the input type.
Source§

impl From<Message> for MessageId

Implemented for syntax sugar, see issue https://github.com/teloxide/teloxide/issues/1143

Source§

fn from(message: Message) -> MessageId

Converts to this type from the input type.
Source§

impl GetChatId for Message

Source§

impl<Out> MessageFilterExt<Out> for Message
where Out: Send + Sync + 'static,

Source§

fn filter_from() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::from filter.
Source§

fn filter_animation() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::animation filter.
Source§

fn filter_audio() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::audio filter.
Source§

fn filter_contact() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::contact filter.
Source§

fn filter_document() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::document filter.
Source§

fn filter_paid_media() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::paid_media filter.
Source§

fn filter_game() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::game filter.
Source§

fn filter_venue() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::venue filter.
Source§

fn filter_location() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::location filter.
Source§

fn filter_photo() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::photo filter.
Source§

fn filter_poll() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::poll filter.
Source§

fn filter_checklist() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::checklist filter.
Source§

fn filter_sticker() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::sticker filter.
Source§

fn filter_story() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::story filter.
Source§

fn filter_text() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::text filter.
Source§

fn filter_video() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::video filter.
Source§

fn filter_video_note() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::video_note filter.
Source§

fn filter_voice() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::voice filter.
Source§

fn filter_migration() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::chat_migration filter.
Source§

fn filter_migration_from() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::migrate_from_chat_id filter.
Source§

fn filter_migration_to() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::migrate_to_chat_id filter.
Source§

fn filter_reply_to_message() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::reply_to_message filter.
Source§

fn filter_forward_origin() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::forward_origin filter.
Source§

fn filter_reply_to_story() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::reply_to_story filter.
Source§

fn filter_new_chat_members() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::new_chat_members filter.
Source§

fn filter_left_chat_member() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::left_chat_member filter.
Source§

fn filter_new_chat_title() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::new_chat_title filter.
Source§

fn filter_new_chat_photo() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::new_chat_photo filter.
Source§

fn filter_delete_chat_photo() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::delete_chat_photo filter.
Source§

fn filter_group_chat_created() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::group_chat_created filter.
Source§

fn filter_supergroup_chat_created() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_channel_chat_created() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::channel_chat_created filter.
Source§

fn filter_message_auto_delete_timer_changed() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_pinned() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::pinned_message filter.
Source§

fn filter_invoice() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::invoice filter.
Source§

fn filter_successful_payment() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::successful_payment filter.
Source§

fn filter_connected_website() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::connected_website filter.
Source§

fn filter_write_access_allowed() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::write_access_allowed filter.
Source§

fn filter_passport_data() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::passport_data filter.
Source§

fn filter_dice() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::dice filter.
Source§

fn filter_proximity_alert_triggered() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_boost_added() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::boost_added filter.
Source§

fn filter_chat_background_set() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::chat_background_set filter.
Source§

fn filter_checklist_tasks_done() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::checklist_tasks_done filter.
Source§

fn filter_checklist_tasks_added() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::checklist_tasks_added filter.
Source§

fn filter_direct_message_price_changed() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_forum_topic_created() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::forum_topic_created filter.
Source§

fn filter_forum_topic_edited() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::forum_topic_edited filter.
Source§

fn filter_forum_topic_closed() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::forum_topic_closed filter.
Source§

fn filter_forum_topic_reopened() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::forum_topic_reopened filter.
Source§

fn filter_general_forum_topic_hidden() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_general_forum_topic_unhidden() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_giveaway() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::giveaway filter.
Source§

fn filter_giveaway_completed() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::giveaway_completed filter.
Source§

fn filter_giveaway_created() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::giveaway_created filter.
Source§

fn filter_giveaway_winners() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::giveaway_winners filter.
Source§

fn filter_paid_message_price_changed() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_gift_info() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::gift_info filter.
Source§

fn filter_unique_gift_info() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::unique_gift_info filter.
Source§

fn filter_video_chat_scheduled() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::video_chat_scheduled filter.
Source§

fn filter_video_chat_started() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::video_chat_started filter.
Source§

fn filter_video_chat_ended() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::video_chat_ended filter.
Source§

fn filter_video_chat_participants_invited() -> Handler<'static, Out, DpHandlerDescription>

Source§

fn filter_web_app_data() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::web_app_data filter.
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 RenderMessageTextHelper for Message

Source§

fn html_text(&self) -> Option<String>

Returns the HTML representation of the message text, if the message contains text. This method will parse the text and any entities (such as bold, italic, links, etc.) and return the HTML-formatted string.
Source§

fn markdown_text(&self) -> Option<String>

Returns the Markdown representation of the message text, if the message contains text. This method will parse the text and any entities (such as bold, italic, links, etc.) and return the Markdown-formatted string.
Source§

fn html_caption(&self) -> Option<String>

Returns the HTML representation of the message caption, if the message contains caption. This method will parse the caption and any entities (such as bold, italic, links, etc.) and return the HTML-formatted string.
Source§

fn markdown_caption(&self) -> Option<String>

Returns the Markdown representation of the message caption, if the message contains caption. This method will parse the caption and any entities (such as bold, italic, links, etc.) and return the Markdown-formatted string.
Source§

impl Serialize for Message

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::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> 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> Erasable for T

Source§

const ACK_1_1_0: bool = true

Available on non-enforce_1_1_0_semantics only.
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Source§

unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>

Unerase this erased pointer. Read more
Source§

fn erase(this: NonNull<Self>) -> NonNull<Erased>

Turn this erasable pointer into an erased pointer. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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