Struct botapi::gen_types::UpdateBuilder
source · pub struct UpdateBuilder { /* private fields */ }Expand description
This object represents an incoming update.At most one of the optional parameters can be present in any given update.
Implementations§
source§impl UpdateBuilder
impl UpdateBuilder
pub fn new(update_id: i64) -> Self
sourcepub fn set_update_id(self, update_id: i64) -> Self
pub fn set_update_id(self, update_id: i64) -> Self
The update’s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
sourcepub fn set_message(self, message: Message) -> Self
pub fn set_message(self, message: Message) -> Self
Optional. New incoming message of any kind - text, photo, sticker, etc.
sourcepub fn set_edited_message(self, edited_message: Message) -> Self
pub fn set_edited_message(self, edited_message: Message) -> Self
Optional. New version of a message that is known to the bot and was edited
sourcepub fn set_channel_post(self, channel_post: Message) -> Self
pub fn set_channel_post(self, channel_post: Message) -> Self
Optional. New incoming channel post of any kind - text, photo, sticker, etc.
sourcepub fn set_edited_channel_post(self, edited_channel_post: Message) -> Self
pub fn set_edited_channel_post(self, edited_channel_post: Message) -> Self
Optional. New version of a channel post that is known to the bot and was edited
sourcepub fn set_inline_query(self, inline_query: InlineQuery) -> Self
pub fn set_inline_query(self, inline_query: InlineQuery) -> Self
Optional. New incoming inline query
sourcepub fn set_chosen_inline_result(
self,
chosen_inline_result: ChosenInlineResult
) -> Self
pub fn set_chosen_inline_result(
self,
chosen_inline_result: ChosenInlineResult
) -> Self
Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
sourcepub fn set_callback_query(self, callback_query: CallbackQuery) -> Self
pub fn set_callback_query(self, callback_query: CallbackQuery) -> Self
Optional. New incoming callback query
sourcepub fn set_shipping_query(self, shipping_query: ShippingQuery) -> Self
pub fn set_shipping_query(self, shipping_query: ShippingQuery) -> Self
Optional. New incoming shipping query. Only for invoices with flexible price
sourcepub fn set_pre_checkout_query(self, pre_checkout_query: PreCheckoutQuery) -> Self
pub fn set_pre_checkout_query(self, pre_checkout_query: PreCheckoutQuery) -> Self
Optional. New incoming pre-checkout query. Contains full information about checkout
sourcepub fn set_poll(self, poll: Poll) -> Self
pub fn set_poll(self, poll: Poll) -> Self
Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
sourcepub fn set_poll_answer(self, poll_answer: PollAnswer) -> Self
pub fn set_poll_answer(self, poll_answer: PollAnswer) -> Self
Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
sourcepub fn set_my_chat_member(self, my_chat_member: ChatMemberUpdated) -> Self
pub fn set_my_chat_member(self, my_chat_member: ChatMemberUpdated) -> Self
Optional. The bot’s chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
sourcepub fn set_chat_member(self, chat_member: ChatMemberUpdated) -> Self
pub fn set_chat_member(self, chat_member: ChatMemberUpdated) -> Self
Optional. A chat member’s status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
sourcepub fn set_chat_join_request(self, chat_join_request: ChatJoinRequest) -> Self
pub fn set_chat_join_request(self, chat_join_request: ChatJoinRequest) -> Self
Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
pub fn build(self) -> Update
Trait Implementations§
source§impl Clone for UpdateBuilder
impl Clone for UpdateBuilder
source§fn clone(&self) -> UpdateBuilder
fn clone(&self) -> UpdateBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more