botapi::gen_types

Struct MessageBuilder

Source
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: i64

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

§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: i64

Date 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

§author_signature: Option<String>

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

§users_shared: Option<BoxWrapper<Unbox<UsersShared>>>

Optional. Service message: users were shared with the bot

§chat_shared: Option<BoxWrapper<Unbox<ChatShared>>>

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

§general_forum_topic_hidden: Option<BoxWrapper<Unbox<GeneralForumTopicHidden>>>

Optional. Service message: the ‘General’ forum topic hidden

§general_forum_topic_unhidden: Option<BoxWrapper<Unbox<GeneralForumTopicUnhidden>>>

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

Source

pub fn new<A: Into<Chat>>(message_id: i64, date: i64, chat: A) -> Self

Source

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

Source

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

Source

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

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

pub fn set_chat(self, chat: Chat) -> Self

Chat the message belongs to

Source

pub fn set_forward_origin(self, forward_origin: MessageOrigin) -> Self

Optional. Information about the original message for forwarded messages

Source

pub fn set_is_topic_message(self, is_topic_message: bool) -> Self

Optional. True, if the message is sent to a forum topic

Source

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

Source

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.

Source

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

Source

pub fn set_quote(self, quote: TextQuote) -> Self

Optional. For replies that quote part of the original message, the quoted part of the message

Source

pub fn set_reply_to_story(self, reply_to_story: Story) -> Self

Optional. For replies to a story, the original story

Source

pub fn set_via_bot(self, via_bot: User) -> Self

Optional. Bot through which the message was sent

Source

pub fn set_edit_date(self, edit_date: i64) -> Self

Optional. Date the message was last edited in Unix time

Source

pub fn set_has_protected_content(self, has_protected_content: bool) -> Self

Optional. True, if the message can’t be forwarded

Source

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

Source

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

Source

pub fn set_author_signature(self, author_signature: String) -> Self

Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

Source

pub fn set_text(self, text: String) -> Self

Optional. For text messages, the actual UTF-8 text of the message

Source

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

Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed

Source

pub fn set_effect_id(self, effect_id: String) -> Self

Optional. Unique identifier of the message effect added to the message

Source

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

Source

pub fn set_audio(self, audio: Audio) -> Self

Optional. Message is an audio file, information about the file

Source

pub fn set_document(self, document: Document) -> Self

Optional. Message is a general file, information about the file

Source

pub fn set_paid_media(self, paid_media: PaidMediaInfo) -> Self

Optional. Message contains paid media; information about the paid media

Source

pub fn set_photo(self, photo: Vec<PhotoSize>) -> Self

Optional. Message is a photo, available sizes of the photo

Source

pub fn set_sticker(self, sticker: Sticker) -> Self

Optional. Message is a sticker, information about the sticker

Source

pub fn set_story(self, story: Story) -> Self

Optional. Message is a forwarded story

Source

pub fn set_video(self, video: Video) -> Self

Optional. Message is a video, information about the video

Source

pub fn set_video_note(self, video_note: VideoNote) -> Self

Optional. Message is a video note, information about the video message

Source

pub fn set_voice(self, voice: Voice) -> Self

Optional. Message is a voice message, information about the file

Source

pub fn set_caption(self, caption: String) -> Self

Optional. Caption for the animation, audio, document, paid media, photo, video or voice

Source

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

Source

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

Source

pub fn set_has_media_spoiler(self, has_media_spoiler: bool) -> Self

Optional. True, if the message media is covered by a spoiler animation

Source

pub fn set_contact(self, contact: Contact) -> Self

Optional. Message is a shared contact, information about the contact

Source

pub fn set_dice(self, dice: Dice) -> Self

Optional. Message is a dice with random value

Source

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

Source

pub fn set_poll(self, poll: Poll) -> Self

Optional. Message is a native poll, information about the poll

Source

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

Source

pub fn set_location(self, location: Location) -> Self

Optional. Message is a shared location, information about the location

Source

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)

Source

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)

Source

pub fn set_new_chat_title(self, new_chat_title: String) -> Self

Optional. A chat title was changed to this value

Source

pub fn set_new_chat_photo(self, new_chat_photo: Vec<PhotoSize>) -> Self

Optional. A chat photo was change to this value

Source

pub fn set_delete_chat_photo(self, delete_chat_photo: bool) -> Self

Optional. Service message: the chat photo was deleted

Source

pub fn set_group_chat_created(self, group_chat_created: bool) -> Self

Optional. Service message: the group has been created

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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

Source

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

Source

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

Source

pub fn set_users_shared(self, users_shared: UsersShared) -> Self

Optional. Service message: users were shared with the bot

Source

pub fn set_chat_shared(self, chat_shared: ChatShared) -> Self

Optional. Service message: a chat was shared with the bot

Source

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

Source

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

Source

pub fn set_passport_data(self, passport_data: PassportData) -> Self

Optional. Telegram Passport data

Source

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.

Source

pub fn set_boost_added(self, boost_added: ChatBoostAdded) -> Self

Optional. Service message: user boosted the chat

Source

pub fn set_chat_background_set( self, chat_background_set: ChatBackground, ) -> Self

Optional. Service message: chat background set

Source

pub fn set_forum_topic_created( self, forum_topic_created: ForumTopicCreated, ) -> Self

Optional. Service message: forum topic created

Source

pub fn set_forum_topic_edited( self, forum_topic_edited: ForumTopicEdited, ) -> Self

Optional. Service message: forum topic edited

Source

pub fn set_forum_topic_closed( self, forum_topic_closed: ForumTopicClosed, ) -> Self

Optional. Service message: forum topic closed

Source

pub fn set_forum_topic_reopened( self, forum_topic_reopened: ForumTopicReopened, ) -> Self

Optional. Service message: forum topic reopened

Source

pub fn set_general_forum_topic_hidden( self, general_forum_topic_hidden: GeneralForumTopicHidden, ) -> Self

Optional. Service message: the ‘General’ forum topic hidden

Source

pub fn set_general_forum_topic_unhidden( self, general_forum_topic_unhidden: GeneralForumTopicUnhidden, ) -> Self

Optional. Service message: the ‘General’ forum topic unhidden

Source

pub fn set_giveaway_created(self, giveaway_created: GiveawayCreated) -> Self

Optional. Service message: a scheduled giveaway was created

Source

pub fn set_giveaway(self, giveaway: Giveaway) -> Self

Optional. The message is a scheduled giveaway message

Source

pub fn set_giveaway_winners(self, giveaway_winners: GiveawayWinners) -> Self

Optional. A giveaway with public winners was completed

Source

pub fn set_giveaway_completed( self, giveaway_completed: Box<GiveawayCompleted>, ) -> Self

Optional. Service message: a giveaway without public winners was completed

Source

pub fn set_video_chat_scheduled( self, video_chat_scheduled: VideoChatScheduled, ) -> Self

Optional. Service message: video chat scheduled

Source

pub fn set_video_chat_started( self, video_chat_started: VideoChatStarted, ) -> Self

Optional. Service message: video chat started

Source

pub fn set_video_chat_ended(self, video_chat_ended: VideoChatEnded) -> Self

Optional. Service message: video chat ended

Source

pub fn set_video_chat_participants_invited( self, video_chat_participants_invited: VideoChatParticipantsInvited, ) -> Self

Optional. Service message: new participants invited to a video chat

Source

pub fn set_web_app_data(self, web_app_data: WebAppData) -> Self

Optional. Service message: data sent by a Web App

Source

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.

Source

pub fn build(self) -> Message

Trait Implementations§

Source§

impl Clone for MessageBuilder

Source§

fn clone(&self) -> MessageBuilder

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MessageBuilder

Source§

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

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

impl Default for MessageBuilder

Source§

fn default() -> MessageBuilder

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MessageBuilder

Source§

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

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

impl Hash for MessageBuilder

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for MessageBuilder

Source§

fn cmp(&self, other: &MessageBuilder) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for MessageBuilder

Source§

fn eq(&self, other: &MessageBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for MessageBuilder

Source§

fn partial_cmp(&self, other: &MessageBuilder) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for MessageBuilder

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for MessageBuilder

Source§

impl StructuralPartialEq for MessageBuilder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T