pub struct MessageBuilder {Show 85 fields
pub message_id: i64,
pub message_thread_id: Option<i64>,
pub from: Option<BoxWrapper<Unbox<User>>>,
pub sender_chat: Option<BoxWrapper<Unbox<Chat>>>,
pub sender_boost_count: Option<i64>,
pub sender_business_bot: Option<BoxWrapper<Unbox<User>>>,
pub date: i64,
pub business_connection_id: Option<String>,
pub chat: BoxWrapper<Unbox<Chat>>,
pub forward_origin: Option<BoxWrapper<Unbox<MessageOrigin>>>,
pub is_topic_message: Option<bool>,
pub is_automatic_forward: Option<bool>,
pub reply_to_message: Option<BoxWrapper<Box<Message>>>,
pub external_reply: Option<BoxWrapper<Unbox<ExternalReplyInfo>>>,
pub quote: Option<BoxWrapper<Unbox<TextQuote>>>,
pub reply_to_story: Option<BoxWrapper<Unbox<Story>>>,
pub via_bot: Option<BoxWrapper<Unbox<User>>>,
pub edit_date: Option<i64>,
pub has_protected_content: Option<bool>,
pub is_from_offline: Option<bool>,
pub media_group_id: Option<String>,
pub author_signature: Option<String>,
pub text: Option<String>,
pub entities: Option<Vec<MessageEntity>>,
pub link_preview_options: Option<BoxWrapper<Unbox<LinkPreviewOptions>>>,
pub effect_id: Option<String>,
pub animation: Option<BoxWrapper<Unbox<Animation>>>,
pub audio: Option<BoxWrapper<Unbox<Audio>>>,
pub document: Option<BoxWrapper<Unbox<Document>>>,
pub paid_media: Option<BoxWrapper<Unbox<PaidMediaInfo>>>,
pub photo: Option<Vec<PhotoSize>>,
pub sticker: Option<BoxWrapper<Unbox<Sticker>>>,
pub story: Option<BoxWrapper<Unbox<Story>>>,
pub video: Option<BoxWrapper<Unbox<Video>>>,
pub video_note: Option<BoxWrapper<Unbox<VideoNote>>>,
pub voice: Option<BoxWrapper<Unbox<Voice>>>,
pub caption: Option<String>,
pub caption_entities: Option<Vec<MessageEntity>>,
pub show_caption_above_media: Option<bool>,
pub has_media_spoiler: Option<bool>,
pub contact: Option<BoxWrapper<Unbox<Contact>>>,
pub dice: Option<BoxWrapper<Unbox<Dice>>>,
pub game: Option<BoxWrapper<Unbox<Game>>>,
pub poll: Option<BoxWrapper<Unbox<Poll>>>,
pub venue: Option<BoxWrapper<Unbox<Venue>>>,
pub location: Option<BoxWrapper<Unbox<Location>>>,
pub new_chat_members: Option<Vec<User>>,
pub left_chat_member: Option<BoxWrapper<Unbox<User>>>,
pub new_chat_title: Option<String>,
pub new_chat_photo: Option<Vec<PhotoSize>>,
pub delete_chat_photo: Option<bool>,
pub group_chat_created: Option<bool>,
pub supergroup_chat_created: Option<bool>,
pub channel_chat_created: Option<bool>,
pub message_auto_delete_timer_changed: Option<BoxWrapper<Unbox<MessageAutoDeleteTimerChanged>>>,
pub migrate_to_chat_id: Option<i64>,
pub migrate_from_chat_id: Option<i64>,
pub pinned_message: Option<BoxWrapper<Box<MaybeInaccessibleMessage>>>,
pub invoice: Option<BoxWrapper<Unbox<Invoice>>>,
pub successful_payment: Option<BoxWrapper<Unbox<SuccessfulPayment>>>,
pub refunded_payment: Option<BoxWrapper<Unbox<RefundedPayment>>>,
pub users_shared: Option<BoxWrapper<Unbox<UsersShared>>>,
pub chat_shared: Option<BoxWrapper<Unbox<ChatShared>>>,
pub connected_website: Option<String>,
pub write_access_allowed: Option<BoxWrapper<Unbox<WriteAccessAllowed>>>,
pub passport_data: Option<BoxWrapper<Unbox<PassportData>>>,
pub proximity_alert_triggered: Option<BoxWrapper<Unbox<ProximityAlertTriggered>>>,
pub boost_added: Option<BoxWrapper<Unbox<ChatBoostAdded>>>,
pub chat_background_set: Option<BoxWrapper<Unbox<ChatBackground>>>,
pub forum_topic_created: Option<BoxWrapper<Unbox<ForumTopicCreated>>>,
pub forum_topic_edited: Option<BoxWrapper<Unbox<ForumTopicEdited>>>,
pub forum_topic_closed: Option<BoxWrapper<Unbox<ForumTopicClosed>>>,
pub forum_topic_reopened: Option<BoxWrapper<Unbox<ForumTopicReopened>>>,
pub general_forum_topic_hidden: Option<BoxWrapper<Unbox<GeneralForumTopicHidden>>>,
pub general_forum_topic_unhidden: Option<BoxWrapper<Unbox<GeneralForumTopicUnhidden>>>,
pub giveaway_created: Option<BoxWrapper<Unbox<GiveawayCreated>>>,
pub giveaway: Option<BoxWrapper<Unbox<Giveaway>>>,
pub giveaway_winners: Option<BoxWrapper<Unbox<GiveawayWinners>>>,
pub giveaway_completed: Option<BoxWrapper<Box<GiveawayCompleted>>>,
pub video_chat_scheduled: Option<BoxWrapper<Unbox<VideoChatScheduled>>>,
pub video_chat_started: Option<BoxWrapper<Unbox<VideoChatStarted>>>,
pub video_chat_ended: Option<BoxWrapper<Unbox<VideoChatEnded>>>,
pub video_chat_participants_invited: Option<BoxWrapper<Unbox<VideoChatParticipantsInvited>>>,
pub web_app_data: Option<BoxWrapper<Unbox<WebAppData>>>,
pub reply_markup: Option<BoxWrapper<Unbox<InlineKeyboardMarkup>>>,
}Expand description
This object represents a message.
Fields§
§message_id: i64Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
message_thread_id: Option<i64>Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
from: Option<BoxWrapper<Unbox<User>>>Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
sender_chat: Option<BoxWrapper<Unbox<Chat>>>Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel’s discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
sender_boost_count: Option<i64>Optional. If the sender of the message boosted the chat, the number of boosts added by the user
sender_business_bot: Option<BoxWrapper<Unbox<User>>>Optional. 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.
date: i64Date the message was sent in Unix time. It is always a positive number, representing a valid date.
business_connection_id: Option<String>Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
chat: BoxWrapper<Unbox<Chat>>Chat the message belongs to
forward_origin: Option<BoxWrapper<Unbox<MessageOrigin>>>Optional. Information about the original message for forwarded messages
is_topic_message: Option<bool>Optional. True, if the message is sent to a forum topic
is_automatic_forward: Option<bool>Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
reply_to_message: Option<BoxWrapper<Box<Message>>>Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
external_reply: Option<BoxWrapper<Unbox<ExternalReplyInfo>>>Optional. Information about the message that is being replied to, which may come from another chat or forum topic
quote: Option<BoxWrapper<Unbox<TextQuote>>>Optional. For replies that quote part of the original message, the quoted part of the message
reply_to_story: Option<BoxWrapper<Unbox<Story>>>Optional. For replies to a story, the original story
via_bot: Option<BoxWrapper<Unbox<User>>>Optional. Bot through which the message was sent
edit_date: Option<i64>Optional. Date the message was last edited in Unix time
has_protected_content: Option<bool>Optional. True, if the message can’t be forwarded
is_from_offline: Option<bool>Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
media_group_id: Option<String>Optional. The unique identifier of a media message group this message belongs to
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
text: Option<String>Optional. For text messages, the actual UTF-8 text of the message
entities: Option<Vec<MessageEntity>>Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
link_preview_options: Option<BoxWrapper<Unbox<LinkPreviewOptions>>>Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
effect_id: Option<String>Optional. Unique identifier of the message effect added to the message
animation: Option<BoxWrapper<Unbox<Animation>>>Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
audio: Option<BoxWrapper<Unbox<Audio>>>Optional. Message is an audio file, information about the file
document: Option<BoxWrapper<Unbox<Document>>>Optional. Message is a general file, information about the file
paid_media: Option<BoxWrapper<Unbox<PaidMediaInfo>>>Optional. Message contains paid media; information about the paid media
photo: Option<Vec<PhotoSize>>Optional. Message is a photo, available sizes of the photo
sticker: Option<BoxWrapper<Unbox<Sticker>>>Optional. Message is a sticker, information about the sticker
story: Option<BoxWrapper<Unbox<Story>>>Optional. Message is a forwarded story
video: Option<BoxWrapper<Unbox<Video>>>Optional. Message is a video, information about the video
video_note: Option<BoxWrapper<Unbox<VideoNote>>>Optional. Message is a video note, information about the video message
voice: Option<BoxWrapper<Unbox<Voice>>>Optional. Message is a voice message, information about the file
caption: Option<String>Optional. Caption for the animation, audio, document, paid media, photo, video or voice
caption_entities: Option<Vec<MessageEntity>>Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
show_caption_above_media: Option<bool>Optional. True, if the caption must be shown above the message media
has_media_spoiler: Option<bool>Optional. True, if the message media is covered by a spoiler animation
contact: Option<BoxWrapper<Unbox<Contact>>>Optional. Message is a shared contact, information about the contact
dice: Option<BoxWrapper<Unbox<Dice>>>Optional. Message is a dice with random value
game: Option<BoxWrapper<Unbox<Game>>>Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games
poll: Option<BoxWrapper<Unbox<Poll>>>Optional. Message is a native poll, information about the poll
venue: Option<BoxWrapper<Unbox<Venue>>>Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
location: Option<BoxWrapper<Unbox<Location>>>Optional. Message is a shared location, information about the location
new_chat_members: Option<Vec<User>>Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
left_chat_member: Option<BoxWrapper<Unbox<User>>>Optional. A member was removed from the group, information about them (this member may be the bot itself)
new_chat_title: Option<String>Optional. A chat title was changed to this value
new_chat_photo: Option<Vec<PhotoSize>>Optional. A chat photo was change to this value
delete_chat_photo: Option<bool>Optional. Service message: the chat photo was deleted
group_chat_created: Option<bool>Optional. Service message: the group has been created
supergroup_chat_created: Option<bool>Optional. Service message: the supergroup has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
channel_chat_created: Option<bool>Optional. Service message: the channel has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
message_auto_delete_timer_changed: Option<BoxWrapper<Unbox<MessageAutoDeleteTimerChanged>>>Optional. Service message: auto-delete timer settings changed in the chat
migrate_to_chat_id: Option<i64>Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
migrate_from_chat_id: Option<i64>Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
pinned_message: Option<BoxWrapper<Box<MaybeInaccessibleMessage>>>Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
invoice: Option<BoxWrapper<Unbox<Invoice>>>Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments
successful_payment: Option<BoxWrapper<Unbox<SuccessfulPayment>>>Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
refunded_payment: Option<BoxWrapper<Unbox<RefundedPayment>>>Optional. Message is a service message about a refunded payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
Optional. Service message: users were shared with the bot
Optional. Service message: a chat was shared with the bot
connected_website: Option<String>Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login
write_access_allowed: Option<BoxWrapper<Unbox<WriteAccessAllowed>>>Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess
passport_data: Option<BoxWrapper<Unbox<PassportData>>>Optional. Telegram Passport data
proximity_alert_triggered: Option<BoxWrapper<Unbox<ProximityAlertTriggered>>>Optional. Service message. A user in the chat triggered another user’s proximity alert while sharing Live Location.
boost_added: Option<BoxWrapper<Unbox<ChatBoostAdded>>>Optional. Service message: user boosted the chat
chat_background_set: Option<BoxWrapper<Unbox<ChatBackground>>>Optional. Service message: chat background set
forum_topic_created: Option<BoxWrapper<Unbox<ForumTopicCreated>>>Optional. Service message: forum topic created
forum_topic_edited: Option<BoxWrapper<Unbox<ForumTopicEdited>>>Optional. Service message: forum topic edited
forum_topic_closed: Option<BoxWrapper<Unbox<ForumTopicClosed>>>Optional. Service message: forum topic closed
forum_topic_reopened: Option<BoxWrapper<Unbox<ForumTopicReopened>>>Optional. Service message: forum topic reopened
Optional. Service message: the ‘General’ forum topic hidden
Optional. Service message: the ‘General’ forum topic unhidden
giveaway_created: Option<BoxWrapper<Unbox<GiveawayCreated>>>Optional. Service message: a scheduled giveaway was created
giveaway: Option<BoxWrapper<Unbox<Giveaway>>>Optional. The message is a scheduled giveaway message
giveaway_winners: Option<BoxWrapper<Unbox<GiveawayWinners>>>Optional. A giveaway with public winners was completed
giveaway_completed: Option<BoxWrapper<Box<GiveawayCompleted>>>Optional. Service message: a giveaway without public winners was completed
video_chat_scheduled: Option<BoxWrapper<Unbox<VideoChatScheduled>>>Optional. Service message: video chat scheduled
video_chat_started: Option<BoxWrapper<Unbox<VideoChatStarted>>>Optional. Service message: video chat started
video_chat_ended: Option<BoxWrapper<Unbox<VideoChatEnded>>>Optional. Service message: video chat ended
video_chat_participants_invited: Option<BoxWrapper<Unbox<VideoChatParticipantsInvited>>>Optional. Service message: new participants invited to a video chat
web_app_data: Option<BoxWrapper<Unbox<WebAppData>>>Optional. Service message: data sent by a Web App
reply_markup: Option<BoxWrapper<Unbox<InlineKeyboardMarkup>>>Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
Implementations§
Source§impl MessageBuilder
impl MessageBuilder
pub fn new<A: Into<Chat>>(message_id: i64, date: i64, chat: A) -> Self
Sourcepub fn set_message_id(self, message_id: i64) -> Self
pub fn set_message_id(self, message_id: i64) -> Self
Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
Sourcepub fn set_message_thread_id(self, message_thread_id: i64) -> Self
pub fn set_message_thread_id(self, message_thread_id: i64) -> Self
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
Sourcepub fn set_from(self, from: User) -> Self
pub fn set_from(self, from: User) -> Self
Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
Sourcepub fn set_sender_chat(self, sender_chat: Chat) -> Self
pub fn set_sender_chat(self, sender_chat: Chat) -> Self
Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel’s discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
Sourcepub fn set_sender_boost_count(self, sender_boost_count: i64) -> Self
pub fn set_sender_boost_count(self, sender_boost_count: i64) -> Self
Optional. If the sender of the message boosted the chat, the number of boosts added by the user
Sourcepub fn set_sender_business_bot(self, sender_business_bot: User) -> Self
pub fn set_sender_business_bot(self, sender_business_bot: User) -> Self
Optional. 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.
Sourcepub fn set_date(self, date: i64) -> Self
pub fn set_date(self, date: i64) -> Self
Date the message was sent in Unix time. It is always a positive number, representing a valid date.
Sourcepub fn set_business_connection_id(self, business_connection_id: String) -> Self
pub fn set_business_connection_id(self, business_connection_id: String) -> Self
Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
Sourcepub fn set_forward_origin(self, forward_origin: MessageOrigin) -> Self
pub fn set_forward_origin(self, forward_origin: MessageOrigin) -> Self
Optional. Information about the original message for forwarded messages
Sourcepub fn set_is_topic_message(self, is_topic_message: bool) -> Self
pub fn set_is_topic_message(self, is_topic_message: bool) -> Self
Optional. True, if the message is sent to a forum topic
Sourcepub fn set_is_automatic_forward(self, is_automatic_forward: bool) -> Self
pub fn set_is_automatic_forward(self, is_automatic_forward: bool) -> Self
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
Sourcepub fn set_reply_to_message(self, reply_to_message: Box<Message>) -> Self
pub fn set_reply_to_message(self, reply_to_message: Box<Message>) -> Self
Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
Sourcepub fn set_external_reply(self, external_reply: ExternalReplyInfo) -> Self
pub fn set_external_reply(self, external_reply: ExternalReplyInfo) -> Self
Optional. Information about the message that is being replied to, which may come from another chat or forum topic
Sourcepub fn set_quote(self, quote: TextQuote) -> Self
pub fn set_quote(self, quote: TextQuote) -> Self
Optional. For replies that quote part of the original message, the quoted part of the message
Sourcepub fn set_reply_to_story(self, reply_to_story: Story) -> Self
pub fn set_reply_to_story(self, reply_to_story: Story) -> Self
Optional. For replies to a story, the original story
Sourcepub fn set_via_bot(self, via_bot: User) -> Self
pub fn set_via_bot(self, via_bot: User) -> Self
Optional. Bot through which the message was sent
Sourcepub fn set_edit_date(self, edit_date: i64) -> Self
pub fn set_edit_date(self, edit_date: i64) -> Self
Optional. Date the message was last edited in Unix time
Sourcepub fn set_has_protected_content(self, has_protected_content: bool) -> Self
pub fn set_has_protected_content(self, has_protected_content: bool) -> Self
Optional. True, if the message can’t be forwarded
Sourcepub fn set_is_from_offline(self, is_from_offline: bool) -> Self
pub fn set_is_from_offline(self, is_from_offline: bool) -> Self
Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
Sourcepub fn set_media_group_id(self, media_group_id: String) -> Self
pub fn set_media_group_id(self, media_group_id: String) -> Self
Optional. The unique identifier of a media message group this message belongs to
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
Sourcepub fn set_text(self, text: String) -> Self
pub fn set_text(self, text: String) -> Self
Optional. For text messages, the actual UTF-8 text of the message
Sourcepub fn set_entities(self, entities: Vec<MessageEntity>) -> Self
pub fn set_entities(self, entities: Vec<MessageEntity>) -> Self
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
Sourcepub fn set_link_preview_options(
self,
link_preview_options: LinkPreviewOptions,
) -> Self
pub fn set_link_preview_options( self, link_preview_options: LinkPreviewOptions, ) -> Self
Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
Sourcepub fn set_effect_id(self, effect_id: String) -> Self
pub fn set_effect_id(self, effect_id: String) -> Self
Optional. Unique identifier of the message effect added to the message
Sourcepub fn set_animation(self, animation: Animation) -> Self
pub fn set_animation(self, animation: Animation) -> Self
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
Sourcepub fn set_audio(self, audio: Audio) -> Self
pub fn set_audio(self, audio: Audio) -> Self
Optional. Message is an audio file, information about the file
Sourcepub fn set_document(self, document: Document) -> Self
pub fn set_document(self, document: Document) -> Self
Optional. Message is a general file, information about the file
Sourcepub fn set_paid_media(self, paid_media: PaidMediaInfo) -> Self
pub fn set_paid_media(self, paid_media: PaidMediaInfo) -> Self
Optional. Message contains paid media; information about the paid media
Sourcepub fn set_photo(self, photo: Vec<PhotoSize>) -> Self
pub fn set_photo(self, photo: Vec<PhotoSize>) -> Self
Optional. Message is a photo, available sizes of the photo
Sourcepub fn set_sticker(self, sticker: Sticker) -> Self
pub fn set_sticker(self, sticker: Sticker) -> Self
Optional. Message is a sticker, information about the sticker
Sourcepub fn set_video(self, video: Video) -> Self
pub fn set_video(self, video: Video) -> Self
Optional. Message is a video, information about the video
Sourcepub fn set_video_note(self, video_note: VideoNote) -> Self
pub fn set_video_note(self, video_note: VideoNote) -> Self
Optional. Message is a video note, information about the video message
Sourcepub fn set_voice(self, voice: Voice) -> Self
pub fn set_voice(self, voice: Voice) -> Self
Optional. Message is a voice message, information about the file
Sourcepub fn set_caption(self, caption: String) -> Self
pub fn set_caption(self, caption: String) -> Self
Optional. Caption for the animation, audio, document, paid media, photo, video or voice
Sourcepub fn set_caption_entities(self, caption_entities: Vec<MessageEntity>) -> Self
pub fn set_caption_entities(self, caption_entities: Vec<MessageEntity>) -> Self
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
Sourcepub fn set_show_caption_above_media(
self,
show_caption_above_media: bool,
) -> Self
pub fn set_show_caption_above_media( self, show_caption_above_media: bool, ) -> Self
Optional. True, if the caption must be shown above the message media
Sourcepub fn set_has_media_spoiler(self, has_media_spoiler: bool) -> Self
pub fn set_has_media_spoiler(self, has_media_spoiler: bool) -> Self
Optional. True, if the message media is covered by a spoiler animation
Sourcepub fn set_contact(self, contact: Contact) -> Self
pub fn set_contact(self, contact: Contact) -> Self
Optional. Message is a shared contact, information about the contact
Sourcepub fn set_game(self, game: Game) -> Self
pub fn set_game(self, game: Game) -> Self
Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games
Sourcepub fn set_poll(self, poll: Poll) -> Self
pub fn set_poll(self, poll: Poll) -> Self
Optional. Message is a native poll, information about the poll
Sourcepub fn set_venue(self, venue: Venue) -> Self
pub fn set_venue(self, venue: Venue) -> Self
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
Sourcepub fn set_location(self, location: Location) -> Self
pub fn set_location(self, location: Location) -> Self
Optional. Message is a shared location, information about the location
Sourcepub fn set_new_chat_members(self, new_chat_members: Vec<User>) -> Self
pub fn set_new_chat_members(self, new_chat_members: Vec<User>) -> Self
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
Sourcepub fn set_left_chat_member(self, left_chat_member: User) -> Self
pub fn set_left_chat_member(self, left_chat_member: User) -> Self
Optional. A member was removed from the group, information about them (this member may be the bot itself)
Sourcepub fn set_new_chat_title(self, new_chat_title: String) -> Self
pub fn set_new_chat_title(self, new_chat_title: String) -> Self
Optional. A chat title was changed to this value
Sourcepub fn set_new_chat_photo(self, new_chat_photo: Vec<PhotoSize>) -> Self
pub fn set_new_chat_photo(self, new_chat_photo: Vec<PhotoSize>) -> Self
Optional. A chat photo was change to this value
Sourcepub fn set_delete_chat_photo(self, delete_chat_photo: bool) -> Self
pub fn set_delete_chat_photo(self, delete_chat_photo: bool) -> Self
Optional. Service message: the chat photo was deleted
Sourcepub fn set_group_chat_created(self, group_chat_created: bool) -> Self
pub fn set_group_chat_created(self, group_chat_created: bool) -> Self
Optional. Service message: the group has been created
Sourcepub fn set_supergroup_chat_created(self, supergroup_chat_created: bool) -> Self
pub fn set_supergroup_chat_created(self, supergroup_chat_created: bool) -> Self
Optional. Service message: the supergroup has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
Sourcepub fn set_channel_chat_created(self, channel_chat_created: bool) -> Self
pub fn set_channel_chat_created(self, channel_chat_created: bool) -> Self
Optional. Service message: the channel has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
Sourcepub fn set_message_auto_delete_timer_changed(
self,
message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged,
) -> Self
pub fn set_message_auto_delete_timer_changed( self, message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged, ) -> Self
Optional. Service message: auto-delete timer settings changed in the chat
Sourcepub fn set_migrate_to_chat_id(self, migrate_to_chat_id: i64) -> Self
pub fn set_migrate_to_chat_id(self, migrate_to_chat_id: i64) -> Self
Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Sourcepub fn set_migrate_from_chat_id(self, migrate_from_chat_id: i64) -> Self
pub fn set_migrate_from_chat_id(self, migrate_from_chat_id: i64) -> Self
Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Sourcepub fn set_pinned_message(
self,
pinned_message: Box<MaybeInaccessibleMessage>,
) -> Self
pub fn set_pinned_message( self, pinned_message: Box<MaybeInaccessibleMessage>, ) -> Self
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
Sourcepub fn set_invoice(self, invoice: Invoice) -> Self
pub fn set_invoice(self, invoice: Invoice) -> Self
Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments
Sourcepub fn set_successful_payment(
self,
successful_payment: SuccessfulPayment,
) -> Self
pub fn set_successful_payment( self, successful_payment: SuccessfulPayment, ) -> Self
Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
Sourcepub fn set_refunded_payment(self, refunded_payment: RefundedPayment) -> Self
pub fn set_refunded_payment(self, refunded_payment: RefundedPayment) -> Self
Optional. Message is a service message about a refunded payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
Optional. Service message: users were shared with the bot
Optional. Service message: a chat was shared with the bot
Sourcepub fn set_connected_website(self, connected_website: String) -> Self
pub fn set_connected_website(self, connected_website: String) -> Self
Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login
Sourcepub fn set_write_access_allowed(
self,
write_access_allowed: WriteAccessAllowed,
) -> Self
pub fn set_write_access_allowed( self, write_access_allowed: WriteAccessAllowed, ) -> Self
Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess
Sourcepub fn set_passport_data(self, passport_data: PassportData) -> Self
pub fn set_passport_data(self, passport_data: PassportData) -> Self
Optional. Telegram Passport data
Sourcepub fn set_proximity_alert_triggered(
self,
proximity_alert_triggered: ProximityAlertTriggered,
) -> Self
pub fn set_proximity_alert_triggered( self, proximity_alert_triggered: ProximityAlertTriggered, ) -> Self
Optional. Service message. A user in the chat triggered another user’s proximity alert while sharing Live Location.
Sourcepub fn set_boost_added(self, boost_added: ChatBoostAdded) -> Self
pub fn set_boost_added(self, boost_added: ChatBoostAdded) -> Self
Optional. Service message: user boosted the chat
Sourcepub fn set_chat_background_set(
self,
chat_background_set: ChatBackground,
) -> Self
pub fn set_chat_background_set( self, chat_background_set: ChatBackground, ) -> Self
Optional. Service message: chat background set
Sourcepub fn set_forum_topic_created(
self,
forum_topic_created: ForumTopicCreated,
) -> Self
pub fn set_forum_topic_created( self, forum_topic_created: ForumTopicCreated, ) -> Self
Optional. Service message: forum topic created
Sourcepub fn set_forum_topic_edited(
self,
forum_topic_edited: ForumTopicEdited,
) -> Self
pub fn set_forum_topic_edited( self, forum_topic_edited: ForumTopicEdited, ) -> Self
Optional. Service message: forum topic edited
Sourcepub fn set_forum_topic_closed(
self,
forum_topic_closed: ForumTopicClosed,
) -> Self
pub fn set_forum_topic_closed( self, forum_topic_closed: ForumTopicClosed, ) -> Self
Optional. Service message: forum topic closed
Sourcepub fn set_forum_topic_reopened(
self,
forum_topic_reopened: ForumTopicReopened,
) -> Self
pub fn set_forum_topic_reopened( self, forum_topic_reopened: ForumTopicReopened, ) -> Self
Optional. Service message: forum topic reopened
Optional. Service message: the ‘General’ forum topic hidden
Optional. Service message: the ‘General’ forum topic unhidden
Sourcepub fn set_giveaway_created(self, giveaway_created: GiveawayCreated) -> Self
pub fn set_giveaway_created(self, giveaway_created: GiveawayCreated) -> Self
Optional. Service message: a scheduled giveaway was created
Sourcepub fn set_giveaway(self, giveaway: Giveaway) -> Self
pub fn set_giveaway(self, giveaway: Giveaway) -> Self
Optional. The message is a scheduled giveaway message
Sourcepub fn set_giveaway_winners(self, giveaway_winners: GiveawayWinners) -> Self
pub fn set_giveaway_winners(self, giveaway_winners: GiveawayWinners) -> Self
Optional. A giveaway with public winners was completed
Sourcepub fn set_giveaway_completed(
self,
giveaway_completed: Box<GiveawayCompleted>,
) -> Self
pub fn set_giveaway_completed( self, giveaway_completed: Box<GiveawayCompleted>, ) -> Self
Optional. Service message: a giveaway without public winners was completed
Sourcepub fn set_video_chat_scheduled(
self,
video_chat_scheduled: VideoChatScheduled,
) -> Self
pub fn set_video_chat_scheduled( self, video_chat_scheduled: VideoChatScheduled, ) -> Self
Optional. Service message: video chat scheduled
Sourcepub fn set_video_chat_started(
self,
video_chat_started: VideoChatStarted,
) -> Self
pub fn set_video_chat_started( self, video_chat_started: VideoChatStarted, ) -> Self
Optional. Service message: video chat started
Sourcepub fn set_video_chat_ended(self, video_chat_ended: VideoChatEnded) -> Self
pub fn set_video_chat_ended(self, video_chat_ended: VideoChatEnded) -> Self
Optional. Service message: video chat ended
Sourcepub fn set_video_chat_participants_invited(
self,
video_chat_participants_invited: VideoChatParticipantsInvited,
) -> Self
pub fn set_video_chat_participants_invited( self, video_chat_participants_invited: VideoChatParticipantsInvited, ) -> Self
Optional. Service message: new participants invited to a video chat
Sourcepub fn set_web_app_data(self, web_app_data: WebAppData) -> Self
pub fn set_web_app_data(self, web_app_data: WebAppData) -> Self
Optional. Service message: data sent by a Web App
Sourcepub fn set_reply_markup(self, reply_markup: InlineKeyboardMarkup) -> Self
pub fn set_reply_markup(self, reply_markup: InlineKeyboardMarkup) -> Self
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
pub fn build(self) -> Message
Trait Implementations§
Source§impl Clone for MessageBuilder
impl Clone for MessageBuilder
Source§fn clone(&self) -> MessageBuilder
fn clone(&self) -> MessageBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageBuilder
impl Debug for MessageBuilder
Source§impl Default for MessageBuilder
impl Default for MessageBuilder
Source§fn default() -> MessageBuilder
fn default() -> MessageBuilder
Source§impl<'de> Deserialize<'de> for MessageBuilder
impl<'de> Deserialize<'de> for MessageBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for MessageBuilder
impl Hash for MessageBuilder
Source§impl Ord for MessageBuilder
impl Ord for MessageBuilder
Source§fn cmp(&self, other: &MessageBuilder) -> Ordering
fn cmp(&self, other: &MessageBuilder) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for MessageBuilder
impl PartialEq for MessageBuilder
Source§impl PartialOrd for MessageBuilder
impl PartialOrd for MessageBuilder
Source§impl Serialize for MessageBuilder
impl Serialize for MessageBuilder
impl Eq for MessageBuilder
impl StructuralPartialEq for MessageBuilder
Auto Trait Implementations§
impl Freeze for MessageBuilder
impl RefUnwindSafe for MessageBuilder
impl Send for MessageBuilder
impl Sync for MessageBuilder
impl Unpin for MessageBuilder
impl UnwindSafe for MessageBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.