Skip to main content

Message

Struct Message 

Source
pub struct Message {
Show 18 fields pub id: MessageId, pub thread_id: Option<ThreadId>, pub direct_messages_topic: Option<DirectMessagesTopic>, pub from: Option<User>, pub sender_chat: Option<Chat>, pub date: DateTime<Utc>, pub chat: Chat, pub is_topic_message: bool, pub suggested_post_info: Option<SuggestedPostInfo>, pub is_paid_post: bool, pub via_bot: Option<User>, pub sender_business_bot: Option<User>, pub guest_query_id: Option<String>, pub guest_bot_caller_user: Option<User>, pub guest_bot_caller_chat: Option<Chat>, pub receiver_user: Option<User>, pub ephemeral_message_id: Option<MessageId>, 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.

§direct_messages_topic: Option<DirectMessagesTopic>

Information about the direct messages chat topic that contains the message

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

§suggested_post_info: Option<SuggestedPostInfo>

Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can’t be edited.

§is_paid_post: bool

true, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can’t be edited.

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

§guest_query_id: Option<String>

Unique identifier of the query that resulted in the message.

§guest_bot_caller_user: Option<User>

User that sent the message on behalf of the guest bot.

§guest_bot_caller_chat: Option<Chat>

Chat that sent the message on behalf of the guest bot.

§receiver_user: Option<User>

The user who can receive an ephemeral message.

§ephemeral_message_id: Option<MessageId>

Unique identifier of an ephemeral message.

§kind: MessageKind

Implementations§

Source§

impl Message

Getters for Message fields from telegram docs.

Source

pub fn widget(&self) -> Option<&Widget>

Returns the HTML widget in this message, if any.

Source

pub fn paid_messages_waived(&self) -> Option<&PaidMessagesWaived>

Returns the message fee waiver, if any.

Source

pub fn ton_wallet_transfer(&self) -> Option<&TonWalletTransfer>

Returns the TON wallet transfer, if any.

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 sender_tag(&self) -> Option<&str>

Source

pub fn reply_to_poll_option_id(&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("Use this command in reply to another message")
86                .chat_id(msg.chat.id)
87                .await?;
88        }
89    }
90    Ok(())
91}
92
93// Ban a user with replied message.
94async fn ban_user(bot: Bot, msg: Message, time: Duration) -> ResponseResult<()> {
95    match msg.reply_to_message() {
96        Some(replied) => {
97            bot.kick_chat_member(
98                msg.chat.id,
99                replied.from.as_ref().expect("Must be MessageKind::Common").id,
100            )
101            .until_date(msg.date + time)
102            .await?;
103        }
104        None => {
105            bot.send_message("Use this command in a reply to another message!")
106                .chat_id(msg.chat.id)
107                .await?;
108        }
109    }
110    Ok(())
111}
112
113// Mute a user with a replied message.
114async fn mute_user(bot: Bot, msg: Message, time: Duration) -> ResponseResult<()> {
115    match msg.reply_to_message() {
116        Some(replied) => {
117            bot.restrict_chat_member(
118                msg.chat.id,
119                replied.from.as_ref().expect("Must be MessageKind::Common").id,
120                ChatPermissions::empty(),
121            )
122            .until_date(msg.date + time)
123            .await?;
124        }
125        None => {
126            bot.send_message("Use this command in a reply to another message!")
127                .chat_id(msg.chat.id)
128                .await?;
129        }
130    }
131    Ok(())
132}
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("How old are you?").chat_id(msg.chat.id).await?;
70            dialogue.update(State::ReceiveAge { full_name: text.into() }).await?;
71        }
72        None => {
73            bot.send_message("Send me plain text.").chat_id(msg.chat.id).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("What's your location?").chat_id(msg.chat.id).await?;
89            dialogue.update(State::ReceiveLocation { full_name, age }).await?;
90        }
91        _ => {
92            bot.send_message("Send me a number.").chat_id(msg.chat.id).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(report).chat_id(msg.chat.id).await?;
109            dialogue.exit().await?;
110        }
111        None => {
112            bot.send_message("Send me plain text.").chat_id(msg.chat.id).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(format!("Remembered number {n}. Now use /get or /reset."))
69                .chat_id(msg.chat.id)
70                .await?;
71        }
72        _ => {
73            bot.send_message("Please, send me a number.").chat_id(msg.chat.id).await?;
74        }
75    }
76
77    Ok(())
78}
examples/purchase.rs (line 112)
111async fn receive_full_name(bot: Bot, dialogue: MyDialogue, msg: Message) -> HandlerResult {
112    match msg.text().map(ToOwned::to_owned) {
113        Some(full_name) => {
114            let products = ["Apple", "Banana", "Orange", "Potato"]
115                .map(|product| InlineKeyboardButton::callback(product, product));
116
117            bot.send_message("Select a product:")
118                .chat_id(msg.chat.id)
119                .reply_markup(InlineKeyboardMarkup::new([products]))
120                .await?;
121            dialogue.update(State::ReceiveProductChoice { full_name }).await?;
122        }
123        None => {
124            bot.send_message("Please, send me your full name.").chat_id(msg.chat.id).await?;
125        }
126    }
127
128    Ok(())
129}
examples/buttons.rs (line 68)
63async fn message_handler(
64    bot: Bot,
65    msg: Message,
66    me: BotFullInfo,
67) -> Result<(), Box<dyn Error + Send + Sync>> {
68    if let Some(text) = msg.text() {
69        match BotCommands::parse(text, me.username().unwrap_or_default()) {
70            Ok(Command::Help) => {
71                // Just send the description of all commands.
72                bot.send_message(Command::descriptions().to_string()).chat_id(msg.chat.id).await?;
73            }
74            Ok(Command::Start) => {
75                // Create a list of buttons and send them.
76                let keyboard = make_keyboard();
77                bot.send_message("Debian versions:")
78                    .chat_id(msg.chat.id)
79                    .reply_markup(keyboard)
80                    .await?;
81            }
82
83            Err(_) => {
84                bot.send_message("Command not found!").chat_id(msg.chat.id).await?;
85            }
86        }
87    }
88
89    Ok(())
90}
examples/update_stream.rs (line 17)
5async fn main() -> std::io::Result<()> {
6    pretty_env_logger::init();
7    let bot = Bot::from_env();
8    let mut updates = bot.update_stream().build().await;
9    let mut ctrl_c = std::pin::pin!(tokio::signal::ctrl_c());
10    let mut stopping = false;
11
12    loop {
13        tokio::select! {
14            item = updates.next() => match item {
15                Some(Ok(update)) => {
16                    if let UpdateKind::Message(message) = update.kind {
17                        if let Some(text) = message.text() {
18                            bot.send_message(text).chat_id(message.chat.id).await.log_on_error().await;
19                        }
20                    }
21                }
22                Some(Err(error)) => log::error!("Could not receive update: {error}"),
23                None => break,
24            },
25            signal = &mut ctrl_c, if !stopping => {
26                signal?;
27                updates.shutdown();
28                stopping = true;
29            }
30        }
31    }
32
33    Ok(())
34}
examples/deep_linking.rs (line 106)
99pub async fn send_message(
100    bot: Bot,
101    id: ChatId, // Available from `State::WriteToSomeone`
102    msg: Message,
103    dialogue: MyDialogue,
104    me: BotFullInfo,
105) -> HandlerResult {
106    match msg.text() {
107        Some(text) => {
108            // Trying to send a message to the user
109            let sent_result = bot
110                .send_message(format!("You have a new message!\n\n<i>{text}</i>"))
111                .chat_id(id)
112                .parse_mode(ParseMode::Html)
113                .await;
114
115            // And if no error is returned, success!
116            if sent_result.is_ok() {
117                bot.send_message(format!(
118                    "Message sent!\n\nYour link is: {}?start={}",
119                    me.tme_url().ok_or("The bot needs a public username for deep links")?,
120                    msg.chat.id
121                ))
122                .chat_id(msg.chat.id)
123                .await?;
124            } else {
125                bot.send_message("Error sending message! Maybe user blocked the bot?")
126                    .chat_id(msg.chat.id)
127                    .await?;
128            }
129            dialogue.exit().await?;
130        }
131        None => {
132            bot.send_message("This bot can send only text.").chat_id(msg.chat.id).await?;
133        }
134    };
135    Ok(())
136}
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 rich_message(&self) -> Option<&RichMessage>

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

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, MediaLivePhoto::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 live_photo(&self) -> Option<&LivePhoto>

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 chat_owner_left(&self) -> Option<&ChatOwnerLeft>

Source

pub fn chat_owner_changed(&self) -> Option<&ChatOwnerChanged>

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 suggested_post_approval_failed( &self, ) -> Option<&SuggestedPostApprovalFailed>

Source

pub fn suggested_post_approved(&self) -> Option<&SuggestedPostApproved>

Source

pub fn suggested_post_declined(&self) -> Option<&SuggestedPostDeclined>

Source

pub fn suggested_post_paid(&self) -> Option<&SuggestedPostPaid>

Source

pub fn suggested_post_refunded(&self) -> Option<&SuggestedPostRefunded>

Source

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

Source

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

Source

pub fn managed_bot_created(&self) -> Option<&ManagedBotCreated>

Source

pub fn community_chat_joined(&self) -> Option<&CommunityChatJoined>

Source

pub fn poll_option_added(&self) -> Option<&PollOptionAdded>

Source

pub fn poll_option_deleted(&self) -> Option<&PollOptionDeleted>

Source

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

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 (const: unstable) · 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_widget() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::widget filter.
Source§

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

Applies the Message::paid_messages_waived filter.
Source§

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

Applies the Message::ton_wallet_transfer 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_suggested_post_approved() -> Handler<'static, Out, DpHandlerDescription>

Source§

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

Source§

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

Source§

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

Applies the Message::suggested_post_paid filter.
Source§

fn filter_suggested_post_refunded() -> 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_managed_bot_created() -> Handler<'static, Out, DpHandlerDescription>

Applies the Message::managed_bot_created filter.
Source§

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

Applies the Message::poll_option_added filter.
Source§

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

Applies the Message::poll_option_deleted 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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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§

§

impl Forget for Message

§

impl Freeze for Message

§

impl Move for Message

§

impl RefUnwindSafe for Message

§

impl Send for Message
where RawVecInner: Send, NonZero<i32>: Send, Utc: Send, BoxRaw<Message>: Send, &'static str: Send, BoxRaw<PaidMediaVideo>: Send, BoxRaw<RichTextKind>: Send, BoxRaw<MediaPoll>: Send, BoxRaw<MaybeInaccessibleMessage>: Send,

§

impl Sync for Message
where RawVecInner: Sync, NonZero<i32>: Sync, Utc: Sync, BoxRaw<Message>: Sync, BoxRaw<PaidMediaVideo>: Sync, BoxRaw<RichTextKind>: Sync, BoxRaw<MediaPoll>: Sync, BoxRaw<MaybeInaccessibleMessage>: Sync,

§

impl Unpin for Message

§

impl UnsafeUnpin for Message

§

impl UnwindSafe for Message

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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