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.
Fields§
§id: MessageIdUnique 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: ChatConversation the message belongs to.
is_topic_message: booltrue, 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: booltrue, 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: MessageKindImplementations§
Source§impl Message
Getters for Message fields from telegram docs.
impl Message
Getters for Message fields from telegram docs.
Sourcepub fn paid_messages_waived(&self) -> Option<&PaidMessagesWaived>
pub fn paid_messages_waived(&self) -> Option<&PaidMessagesWaived>
Returns the message fee waiver, if any.
Sourcepub fn ton_wallet_transfer(&self) -> Option<&TonWalletTransfer>
pub fn ton_wallet_transfer(&self) -> Option<&TonWalletTransfer>
Returns the TON wallet transfer, if any.
Sourcepub fn from(&self) -> Option<&User>
👎Deprecated since 0.13.0: use .from field instead
pub fn from(&self) -> Option<&User>
use .from field instead
Returns the user who sent the message.
pub fn sender_tag(&self) -> Option<&str>
pub fn reply_to_poll_option_id(&self) -> Option<&str>
pub fn effect_id(&self) -> Option<&EffectId>
pub fn sender_chat(&self) -> Option<&Chat>
use .sender_chat field instead
pub fn forward_origin(&self) -> Option<&MessageOrigin>
pub fn quote(&self) -> Option<&TextQuote>
pub fn reply_to_story(&self) -> Option<&Story>
pub fn sender_boost_count(&self) -> Option<u16>
pub fn forward_date(&self) -> Option<DateTime<Utc>>
pub fn forward_from_user(&self) -> Option<&User>
pub fn forward_from_chat(&self) -> Option<&Chat>
pub fn forward_from_sender_name(&self) -> Option<&str>
pub fn forward_from_message_id(&self) -> Option<MessageId>
Sourcepub fn reply_to_message(&self) -> Option<&Message>
pub fn reply_to_message(&self) -> Option<&Message>
pub fn edit_date(&self) -> Option<&DateTime<Utc>>
pub fn media_group_id(&self) -> Option<&MediaGroupId>
Sourcepub fn text(&self) -> Option<&str>
pub fn text(&self) -> Option<&str>
Examples found in repository?
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
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}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}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}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}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}Sourcepub fn entities(&self) -> Option<&[MessageEntity]>
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.
pub fn link_preview_options(&self) -> Option<&LinkPreviewOptions>
pub fn rich_message(&self) -> Option<&RichMessage>
Sourcepub fn caption_entities(&self) -> Option<&[MessageEntity]>
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.
Sourcepub fn show_caption_above_media(&self) -> bool
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,
MediaLivePhoto::show_caption_above_media,
MediaVideo::show_caption_above_media and
MediaAnimation::show_caption_above_media.
Sourcepub fn has_media_spoiler(&self) -> bool
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.
pub fn audio(&self) -> Option<&Audio>
pub fn document(&self) -> Option<&Document>
pub fn paid_media(&self) -> Option<&PaidMediaInfo>
pub fn animation(&self) -> Option<&Animation>
pub fn game(&self) -> Option<&Game>
pub fn photo(&self) -> Option<&[PhotoSize]>
pub fn live_photo(&self) -> Option<&LivePhoto>
pub fn sticker(&self) -> Option<&Sticker>
pub fn story(&self) -> Option<&Story>
pub fn video(&self) -> Option<&Video>
pub fn voice(&self) -> Option<&Voice>
pub fn video_note(&self) -> Option<&VideoNote>
pub fn caption(&self) -> Option<&str>
pub fn contact(&self) -> Option<&Contact>
pub fn location(&self) -> Option<&Location>
pub fn venue(&self) -> Option<&Venue>
pub fn poll(&self) -> Option<&Poll>
pub fn checklist(&self) -> Option<&Checklist>
pub fn new_chat_members(&self) -> Option<&[User]>
pub fn left_chat_member(&self) -> Option<&User>
pub fn chat_owner_left(&self) -> Option<&ChatOwnerLeft>
pub fn chat_owner_changed(&self) -> Option<&ChatOwnerChanged>
pub fn new_chat_title(&self) -> Option<&str>
pub fn new_chat_photo(&self) -> Option<&[PhotoSize]>
Sourcepub fn is_delete_chat_photo(&self) -> bool
pub fn is_delete_chat_photo(&self) -> bool
Returns true if the incoming Message contains the
delete_chat_photo Service message.
pub fn delete_chat_photo(&self) -> Option<&MessageDeleteChatPhoto>
Sourcepub fn is_group_chat_created(&self) -> bool
pub fn is_group_chat_created(&self) -> bool
Returns true if the incoming Message contains the
group_chat_created Service message.
pub fn group_chat_created(&self) -> Option<&MessageGroupChatCreated>
Sourcepub fn is_super_group_chat_created(&self) -> bool
pub fn is_super_group_chat_created(&self) -> bool
Returns true if the incoming Message contains the
supergroup_chat_created Service message.
pub fn super_group_chat_created(&self) -> Option<&MessageSupergroupChatCreated>
Sourcepub fn is_channel_chat_created(&self) -> bool
pub fn is_channel_chat_created(&self) -> bool
Returns true if the incoming Message contains the
channel_chat_created Service message.
pub fn channel_chat_created(&self) -> Option<&MessageChannelChatCreated>
pub fn message_auto_delete_timer_changed( &self, ) -> Option<&MessageAutoDeleteTimerChanged>
pub fn chat_migration(&self) -> Option<&ChatMigration>
pub fn migrate_to_chat_id(&self) -> Option<&ChatId>
pub fn migrate_from_chat_id(&self) -> Option<&ChatId>
pub fn pinned_message(&self) -> Option<&MaybeInaccessibleMessage>
pub fn invoice(&self) -> Option<&Invoice>
pub fn successful_payment(&self) -> Option<&SuccessfulPayment>
pub fn connected_website(&self) -> Option<&str>
pub fn write_access_allowed(&self) -> Option<&WriteAccessAllowed>
pub fn passport_data(&self) -> Option<&PassportData>
pub fn dice(&self) -> Option<&Dice>
pub fn proximity_alert_triggered(&self) -> Option<&ProximityAlertTriggered>
pub fn boost_added(&self) -> Option<&ChatBoostAdded>
pub fn chat_background_set(&self) -> Option<&ChatBackground>
pub fn checklist_tasks_done(&self) -> Option<&ChecklistTasksDone>
pub fn checklist_tasks_added(&self) -> Option<&ChecklistTasksAdded>
pub fn direct_message_price_changed(&self) -> Option<&DirectMessagePriceChanged>
pub fn forum_topic_created(&self) -> Option<&ForumTopicCreated>
pub fn forum_topic_edited(&self) -> Option<&ForumTopicEdited>
pub fn forum_topic_closed(&self) -> Option<&ForumTopicClosed>
pub fn forum_topic_reopened(&self) -> Option<&ForumTopicReopened>
pub fn giveaway(&self) -> Option<&Giveaway>
pub fn giveaway_completed(&self) -> Option<&GiveawayCompleted>
pub fn giveaway_created(&self) -> Option<&GiveawayCreated>
pub fn giveaway_winners(&self) -> Option<&GiveawayWinners>
pub fn paid_message_price_changed(&self) -> Option<&PaidMessagePriceChanged>
pub fn suggested_post_approval_failed( &self, ) -> Option<&SuggestedPostApprovalFailed>
pub fn suggested_post_approved(&self) -> Option<&SuggestedPostApproved>
pub fn suggested_post_declined(&self) -> Option<&SuggestedPostDeclined>
pub fn suggested_post_paid(&self) -> Option<&SuggestedPostPaid>
pub fn suggested_post_refunded(&self) -> Option<&SuggestedPostRefunded>
pub fn gift_info(&self) -> Option<&GiftInfo>
pub fn gift_upgrade_sent(&self) -> Option<&GiftInfo>
pub fn managed_bot_created(&self) -> Option<&ManagedBotCreated>
pub fn community_chat_joined(&self) -> Option<&CommunityChatJoined>
pub fn poll_option_added(&self) -> Option<&PollOptionAdded>
pub fn poll_option_deleted(&self) -> Option<&PollOptionDeleted>
pub fn unique_gift_info(&self) -> Option<&UniqueGiftInfo>
pub fn video_chat_scheduled(&self) -> Option<&VideoChatScheduled>
pub fn video_chat_started(&self) -> Option<&VideoChatStarted>
pub fn video_chat_ended(&self) -> Option<&VideoChatEnded>
pub fn video_chat_participants_invited( &self, ) -> Option<&VideoChatParticipantsInvited>
pub fn web_app_data(&self) -> Option<&WebAppData>
pub fn reply_markup(&self) -> Option<&InlineKeyboardMarkup>
pub fn is_automatic_forward(&self) -> bool
pub fn has_protected_content(&self) -> bool
Source§impl Message
impl Message
Sourcepub fn url(&self) -> Option<Url>
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).
Sourcepub fn url_of(
chat_id: ChatId,
chat_username: Option<&str>,
message_id: MessageId,
) -> Option<Url>
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).
Sourcepub fn comment_url(&self, comment_id: MessageId) -> Option<Url>
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).
Sourcepub fn comment_url_of(
channel_id: ChatId,
channel_username: Option<&str>,
post_id: MessageId,
comment_id: MessageId,
) -> Option<Url>
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).
Sourcepub fn url_in_thread(&self, thread_starter_msg_id: MessageId) -> Option<Url>
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).
Sourcepub fn url_in_thread_of(
chat_id: ChatId,
chat_username: Option<&str>,
thread_starter_msg_id: MessageId,
message_id: MessageId,
) -> Option<Url>
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).
Sourcepub fn parse_entities(&self) -> Option<Vec<MessageEntityRef<'_>>>
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.
Sourcepub fn parse_caption_entities(&self) -> Option<Vec<MessageEntityRef<'_>>>
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.
Sourcepub fn mentioned_users(&self) -> impl Iterator<Item = &User>
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<'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 From<Message> for MessageId
Implemented for syntax sugar, see issue https://github.com/teloxide/teloxide/issues/1143
impl From<Message> for MessageId
Implemented for syntax sugar, see issue https://github.com/teloxide/teloxide/issues/1143
Source§impl GetChatId for Message
impl GetChatId for Message
fn chat_id(&self) -> Option<ChatId>
Source§fn dialogue_key(&self) -> Option<DialogueKey>
fn dialogue_key(&self) -> Option<DialogueKey>
Source§impl<Out> MessageFilterExt<Out> for Message
impl<Out> MessageFilterExt<Out> for Message
Source§fn filter_from() -> Handler<'static, Out, DpHandlerDescription>
fn filter_from() -> Handler<'static, Out, DpHandlerDescription>
Message::from filter.Source§fn filter_animation() -> Handler<'static, Out, DpHandlerDescription>
fn filter_animation() -> Handler<'static, Out, DpHandlerDescription>
Message::animation filter.Source§fn filter_audio() -> Handler<'static, Out, DpHandlerDescription>
fn filter_audio() -> Handler<'static, Out, DpHandlerDescription>
Message::audio filter.Source§fn filter_contact() -> Handler<'static, Out, DpHandlerDescription>
fn filter_contact() -> Handler<'static, Out, DpHandlerDescription>
Message::contact filter.Source§fn filter_document() -> Handler<'static, Out, DpHandlerDescription>
fn filter_document() -> Handler<'static, Out, DpHandlerDescription>
Message::document filter.Source§fn filter_paid_media() -> Handler<'static, Out, DpHandlerDescription>
fn filter_paid_media() -> Handler<'static, Out, DpHandlerDescription>
Message::paid_media filter.Source§fn filter_game() -> Handler<'static, Out, DpHandlerDescription>
fn filter_game() -> Handler<'static, Out, DpHandlerDescription>
Message::game filter.Source§fn filter_venue() -> Handler<'static, Out, DpHandlerDescription>
fn filter_venue() -> Handler<'static, Out, DpHandlerDescription>
Message::venue filter.Source§fn filter_location() -> Handler<'static, Out, DpHandlerDescription>
fn filter_location() -> Handler<'static, Out, DpHandlerDescription>
Message::location filter.Source§fn filter_photo() -> Handler<'static, Out, DpHandlerDescription>
fn filter_photo() -> Handler<'static, Out, DpHandlerDescription>
Message::photo filter.Source§fn filter_poll() -> Handler<'static, Out, DpHandlerDescription>
fn filter_poll() -> Handler<'static, Out, DpHandlerDescription>
Message::poll filter.Source§fn filter_checklist() -> Handler<'static, Out, DpHandlerDescription>
fn filter_checklist() -> Handler<'static, Out, DpHandlerDescription>
Message::checklist filter.Source§fn filter_sticker() -> Handler<'static, Out, DpHandlerDescription>
fn filter_sticker() -> Handler<'static, Out, DpHandlerDescription>
Message::sticker filter.Source§fn filter_story() -> Handler<'static, Out, DpHandlerDescription>
fn filter_story() -> Handler<'static, Out, DpHandlerDescription>
Message::story filter.Source§fn filter_text() -> Handler<'static, Out, DpHandlerDescription>
fn filter_text() -> Handler<'static, Out, DpHandlerDescription>
Message::text filter.Source§fn filter_video() -> Handler<'static, Out, DpHandlerDescription>
fn filter_video() -> Handler<'static, Out, DpHandlerDescription>
Message::video filter.Source§fn filter_video_note() -> Handler<'static, Out, DpHandlerDescription>
fn filter_video_note() -> Handler<'static, Out, DpHandlerDescription>
Message::video_note filter.Source§fn filter_voice() -> Handler<'static, Out, DpHandlerDescription>
fn filter_voice() -> Handler<'static, Out, DpHandlerDescription>
Message::voice filter.Source§fn filter_migration() -> Handler<'static, Out, DpHandlerDescription>
fn filter_migration() -> Handler<'static, Out, DpHandlerDescription>
Message::chat_migration filter.Source§fn filter_migration_from() -> Handler<'static, Out, DpHandlerDescription>
fn filter_migration_from() -> Handler<'static, Out, DpHandlerDescription>
Message::migrate_from_chat_id filter.Source§fn filter_migration_to() -> Handler<'static, Out, DpHandlerDescription>
fn filter_migration_to() -> Handler<'static, Out, DpHandlerDescription>
Message::migrate_to_chat_id filter.Source§fn filter_reply_to_message() -> Handler<'static, Out, DpHandlerDescription>
fn filter_reply_to_message() -> Handler<'static, Out, DpHandlerDescription>
Message::reply_to_message filter.Source§fn filter_forward_origin() -> Handler<'static, Out, DpHandlerDescription>
fn filter_forward_origin() -> Handler<'static, Out, DpHandlerDescription>
Message::forward_origin filter.Source§fn filter_reply_to_story() -> Handler<'static, Out, DpHandlerDescription>
fn filter_reply_to_story() -> Handler<'static, Out, DpHandlerDescription>
Message::reply_to_story filter.Source§fn filter_new_chat_members() -> Handler<'static, Out, DpHandlerDescription>
fn filter_new_chat_members() -> Handler<'static, Out, DpHandlerDescription>
Message::new_chat_members filter.Source§fn filter_left_chat_member() -> Handler<'static, Out, DpHandlerDescription>
fn filter_left_chat_member() -> Handler<'static, Out, DpHandlerDescription>
Message::left_chat_member filter.Source§fn filter_new_chat_title() -> Handler<'static, Out, DpHandlerDescription>
fn filter_new_chat_title() -> Handler<'static, Out, DpHandlerDescription>
Message::new_chat_title filter.Source§fn filter_new_chat_photo() -> Handler<'static, Out, DpHandlerDescription>
fn filter_new_chat_photo() -> Handler<'static, Out, DpHandlerDescription>
Message::new_chat_photo filter.Source§fn filter_delete_chat_photo() -> Handler<'static, Out, DpHandlerDescription>
fn filter_delete_chat_photo() -> Handler<'static, Out, DpHandlerDescription>
Message::delete_chat_photo filter.Source§fn filter_group_chat_created() -> Handler<'static, Out, DpHandlerDescription>
fn filter_group_chat_created() -> Handler<'static, Out, DpHandlerDescription>
Message::group_chat_created filter.Source§fn filter_supergroup_chat_created() -> Handler<'static, Out, DpHandlerDescription>
fn filter_supergroup_chat_created() -> Handler<'static, Out, DpHandlerDescription>
Message::super_group_chat_created filter.Source§fn filter_channel_chat_created() -> Handler<'static, Out, DpHandlerDescription>
fn filter_channel_chat_created() -> Handler<'static, Out, DpHandlerDescription>
Message::channel_chat_created filter.Source§fn filter_message_auto_delete_timer_changed() -> Handler<'static, Out, DpHandlerDescription>
fn filter_message_auto_delete_timer_changed() -> Handler<'static, Out, DpHandlerDescription>
Message::message_auto_delete_timer_changed filter.Source§fn filter_pinned() -> Handler<'static, Out, DpHandlerDescription>
fn filter_pinned() -> Handler<'static, Out, DpHandlerDescription>
Message::pinned_message filter.Source§fn filter_invoice() -> Handler<'static, Out, DpHandlerDescription>
fn filter_invoice() -> Handler<'static, Out, DpHandlerDescription>
Message::invoice filter.Source§fn filter_successful_payment() -> Handler<'static, Out, DpHandlerDescription>
fn filter_successful_payment() -> Handler<'static, Out, DpHandlerDescription>
Message::successful_payment filter.Source§fn filter_connected_website() -> Handler<'static, Out, DpHandlerDescription>
fn filter_connected_website() -> Handler<'static, Out, DpHandlerDescription>
Message::connected_website filter.Source§fn filter_write_access_allowed() -> Handler<'static, Out, DpHandlerDescription>
fn filter_write_access_allowed() -> Handler<'static, Out, DpHandlerDescription>
Message::write_access_allowed filter.Source§fn filter_widget() -> Handler<'static, Out, DpHandlerDescription>
fn filter_widget() -> Handler<'static, Out, DpHandlerDescription>
Message::widget filter.Source§fn filter_paid_messages_waived() -> Handler<'static, Out, DpHandlerDescription>
fn filter_paid_messages_waived() -> Handler<'static, Out, DpHandlerDescription>
Message::paid_messages_waived filter.Source§fn filter_ton_wallet_transfer() -> Handler<'static, Out, DpHandlerDescription>
fn filter_ton_wallet_transfer() -> Handler<'static, Out, DpHandlerDescription>
Message::ton_wallet_transfer filter.Source§fn filter_passport_data() -> Handler<'static, Out, DpHandlerDescription>
fn filter_passport_data() -> Handler<'static, Out, DpHandlerDescription>
Message::passport_data filter.Source§fn filter_dice() -> Handler<'static, Out, DpHandlerDescription>
fn filter_dice() -> Handler<'static, Out, DpHandlerDescription>
Message::dice filter.Source§fn filter_proximity_alert_triggered() -> Handler<'static, Out, DpHandlerDescription>
fn filter_proximity_alert_triggered() -> Handler<'static, Out, DpHandlerDescription>
Message::proximity_alert_triggered filter.Source§fn filter_boost_added() -> Handler<'static, Out, DpHandlerDescription>
fn filter_boost_added() -> Handler<'static, Out, DpHandlerDescription>
Message::boost_added filter.Source§fn filter_chat_background_set() -> Handler<'static, Out, DpHandlerDescription>
fn filter_chat_background_set() -> Handler<'static, Out, DpHandlerDescription>
Message::chat_background_set filter.Source§fn filter_checklist_tasks_done() -> Handler<'static, Out, DpHandlerDescription>
fn filter_checklist_tasks_done() -> Handler<'static, Out, DpHandlerDescription>
Message::checklist_tasks_done filter.Source§fn filter_checklist_tasks_added() -> Handler<'static, Out, DpHandlerDescription>
fn filter_checklist_tasks_added() -> Handler<'static, Out, DpHandlerDescription>
Message::checklist_tasks_added filter.Source§fn filter_direct_message_price_changed() -> Handler<'static, Out, DpHandlerDescription>
fn filter_direct_message_price_changed() -> Handler<'static, Out, DpHandlerDescription>
Message::direct_message_price_changed filter.Source§fn filter_forum_topic_created() -> Handler<'static, Out, DpHandlerDescription>
fn filter_forum_topic_created() -> Handler<'static, Out, DpHandlerDescription>
Message::forum_topic_created filter.Source§fn filter_forum_topic_edited() -> Handler<'static, Out, DpHandlerDescription>
fn filter_forum_topic_edited() -> Handler<'static, Out, DpHandlerDescription>
Message::forum_topic_edited filter.Source§fn filter_forum_topic_closed() -> Handler<'static, Out, DpHandlerDescription>
fn filter_forum_topic_closed() -> Handler<'static, Out, DpHandlerDescription>
Message::forum_topic_closed filter.Source§fn filter_forum_topic_reopened() -> Handler<'static, Out, DpHandlerDescription>
fn filter_forum_topic_reopened() -> Handler<'static, Out, DpHandlerDescription>
Message::forum_topic_reopened filter.Message::general_forum_topic_hidden filter.Message::general_forum_topic_unhidden filter.Source§fn filter_giveaway() -> Handler<'static, Out, DpHandlerDescription>
fn filter_giveaway() -> Handler<'static, Out, DpHandlerDescription>
Message::giveaway filter.Source§fn filter_giveaway_completed() -> Handler<'static, Out, DpHandlerDescription>
fn filter_giveaway_completed() -> Handler<'static, Out, DpHandlerDescription>
Message::giveaway_completed filter.Source§fn filter_giveaway_created() -> Handler<'static, Out, DpHandlerDescription>
fn filter_giveaway_created() -> Handler<'static, Out, DpHandlerDescription>
Message::giveaway_created filter.Source§fn filter_giveaway_winners() -> Handler<'static, Out, DpHandlerDescription>
fn filter_giveaway_winners() -> Handler<'static, Out, DpHandlerDescription>
Message::giveaway_winners filter.Source§fn filter_paid_message_price_changed() -> Handler<'static, Out, DpHandlerDescription>
fn filter_paid_message_price_changed() -> Handler<'static, Out, DpHandlerDescription>
Message::paid_message_price_changed filter.Source§fn filter_suggested_post_approved() -> Handler<'static, Out, DpHandlerDescription>
fn filter_suggested_post_approved() -> Handler<'static, Out, DpHandlerDescription>
Message::suggested_post_approved filter.Source§fn filter_suggested_post_approval_failed() -> Handler<'static, Out, DpHandlerDescription>
fn filter_suggested_post_approval_failed() -> Handler<'static, Out, DpHandlerDescription>
Message::suggested_post_approval_failed filter.Source§fn filter_suggested_post_declined() -> Handler<'static, Out, DpHandlerDescription>
fn filter_suggested_post_declined() -> Handler<'static, Out, DpHandlerDescription>
Message::suggested_post_declined filter.Source§fn filter_suggested_post_paid() -> Handler<'static, Out, DpHandlerDescription>
fn filter_suggested_post_paid() -> Handler<'static, Out, DpHandlerDescription>
Message::suggested_post_paid filter.Source§fn filter_suggested_post_refunded() -> Handler<'static, Out, DpHandlerDescription>
fn filter_suggested_post_refunded() -> Handler<'static, Out, DpHandlerDescription>
Message::suggested_post_refunded filter.Source§fn filter_gift_info() -> Handler<'static, Out, DpHandlerDescription>
fn filter_gift_info() -> Handler<'static, Out, DpHandlerDescription>
Message::gift_info filter.Source§fn filter_unique_gift_info() -> Handler<'static, Out, DpHandlerDescription>
fn filter_unique_gift_info() -> Handler<'static, Out, DpHandlerDescription>
Message::unique_gift_info filter.Source§fn filter_managed_bot_created() -> Handler<'static, Out, DpHandlerDescription>
fn filter_managed_bot_created() -> Handler<'static, Out, DpHandlerDescription>
Message::managed_bot_created filter.Source§fn filter_poll_option_added() -> Handler<'static, Out, DpHandlerDescription>
fn filter_poll_option_added() -> Handler<'static, Out, DpHandlerDescription>
Message::poll_option_added filter.Source§fn filter_poll_option_deleted() -> Handler<'static, Out, DpHandlerDescription>
fn filter_poll_option_deleted() -> Handler<'static, Out, DpHandlerDescription>
Message::poll_option_deleted filter.Source§fn filter_video_chat_scheduled() -> Handler<'static, Out, DpHandlerDescription>
fn filter_video_chat_scheduled() -> Handler<'static, Out, DpHandlerDescription>
Message::video_chat_scheduled filter.Source§fn filter_video_chat_started() -> Handler<'static, Out, DpHandlerDescription>
fn filter_video_chat_started() -> Handler<'static, Out, DpHandlerDescription>
Message::video_chat_started filter.Source§fn filter_video_chat_ended() -> Handler<'static, Out, DpHandlerDescription>
fn filter_video_chat_ended() -> Handler<'static, Out, DpHandlerDescription>
Message::video_chat_ended filter.Source§fn filter_video_chat_participants_invited() -> Handler<'static, Out, DpHandlerDescription>
fn filter_video_chat_participants_invited() -> Handler<'static, Out, DpHandlerDescription>
Message::video_chat_participants_invited filter.Source§fn filter_web_app_data() -> Handler<'static, Out, DpHandlerDescription>
fn filter_web_app_data() -> Handler<'static, Out, DpHandlerDescription>
Message::web_app_data filter.Source§impl RenderMessageTextHelper for Message
impl RenderMessageTextHelper for Message
Source§fn html_text(&self) -> Option<String>
fn html_text(&self) -> Option<String>
Source§fn markdown_text(&self) -> Option<String>
fn markdown_text(&self) -> Option<String>
Source§fn html_caption(&self) -> Option<String>
fn html_caption(&self) -> Option<String>
Source§fn markdown_caption(&self) -> Option<String>
fn markdown_caption(&self) -> Option<String>
Source§impl Serialize for Message
impl Serialize for Message
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Forget for Message
impl Freeze for Messagewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
NonZero<i32>: Freeze,
Utc: Freeze,
*const Message is !null: Freeze,
PhantomData<Message>: Freeze,
&'static str: Freeze,
PhantomData<(Indexed, Indexed)>: Freeze,
PhantomData<PaidMedia>: Freeze,
PhantomData<PhotoSize>: Freeze,
PhantomData<MessageEntity>: Freeze,
PhantomData<PollOption>: Freeze,
PhantomData<String>: Freeze,
PhantomData<VideoQuality>: Freeze,
PhantomData<ChecklistTask>: Freeze,
PhantomData<Chat>: Freeze,
PhantomData<CountryCode>: Freeze,
PhantomData<User>: Freeze,
PhantomData<RichText>: Freeze,
*const MediaPoll is !null: Freeze,
PhantomData<MediaPoll>: Freeze,
PhantomData<RichBlock>: Freeze,
PhantomData<Vec<InlineKeyboardButton>>: Freeze,
*const MaybeInaccessibleMessage is !null: Freeze,
PhantomData<MaybeInaccessibleMessage>: Freeze,
PhantomData<SharedUser>: Freeze,
PhantomData<EncryptedPassportElement>: Freeze,
PhantomData<Rgb>: Freeze,
PhantomData<ChecklistTaskId>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for Message
impl RefUnwindSafe for Message
impl Send for Messagewhere
RawVecInner: Send,
NonZero<i32>: Send,
Utc: Send,
BoxRaw<Message>: Send,
&'static str: Send,
BoxRaw<PaidMediaVideo>: Send,
BoxRaw<RichTextKind>: Send,
BoxRaw<MediaPoll>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
BoxRaw<MaybeInaccessibleMessage>: Send,
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Messagewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
*const Message is !null: UnsafeUnpin,
PhantomData<Message>: UnsafeUnpin,
&'static str: UnsafeUnpin,
PhantomData<(Indexed, Indexed)>: UnsafeUnpin,
PhantomData<PaidMedia>: UnsafeUnpin,
PhantomData<PhotoSize>: UnsafeUnpin,
PhantomData<MessageEntity>: UnsafeUnpin,
PhantomData<PollOption>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<VideoQuality>: UnsafeUnpin,
PhantomData<ChecklistTask>: UnsafeUnpin,
PhantomData<Chat>: UnsafeUnpin,
PhantomData<CountryCode>: UnsafeUnpin,
PhantomData<User>: UnsafeUnpin,
PhantomData<RichText>: UnsafeUnpin,
*const MediaPoll is !null: UnsafeUnpin,
PhantomData<MediaPoll>: UnsafeUnpin,
PhantomData<RichBlock>: UnsafeUnpin,
PhantomData<Vec<InlineKeyboardButton>>: UnsafeUnpin,
*const MaybeInaccessibleMessage is !null: UnsafeUnpin,
PhantomData<MaybeInaccessibleMessage>: UnsafeUnpin,
PhantomData<SharedUser>: UnsafeUnpin,
PhantomData<EncryptedPassportElement>: UnsafeUnpin,
PhantomData<Rgb>: UnsafeUnpin,
PhantomData<ChecklistTaskId>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for Messagewhere
RawVecInner: UnwindSafe,
NonZero<i32>: UnwindSafe,
Utc: UnwindSafe,
BoxRaw<Message>: UnwindSafe,
&'static str: UnwindSafe,
BoxRaw<PaidMediaVideo>: UnwindSafe,
BoxRaw<RichTextKind>: UnwindSafe,
BoxRaw<MediaPoll>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BoxRaw<MaybeInaccessibleMessage>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Erasable for T
impl<T> Erasable for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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