pub struct Update { /* 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 Update
impl Update
pub fn new(update_id: i64) -> Self
sourcepub fn get_update_id<'a>(&'a self) -> i64
pub fn get_update_id<'a>(&'a self) -> i64
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 get_update_id_ref<'a>(&'a self) -> i64
pub fn get_update_id_ref<'a>(&'a self) -> i64
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 get_message<'a>(&'a self) -> Option<Cow<'a, Message>>
pub fn get_message<'a>(&'a self) -> Option<Cow<'a, Message>>
Optional. New incoming message of any kind - text, photo, sticker, etc.
sourcepub fn get_message_ref<'a>(&'a self) -> Option<&'a Message>
pub fn get_message_ref<'a>(&'a self) -> Option<&'a Message>
Optional. New incoming message of any kind - text, photo, sticker, etc.
sourcepub fn get_edited_message<'a>(&'a self) -> Option<Cow<'a, Message>>
pub fn get_edited_message<'a>(&'a self) -> Option<Cow<'a, Message>>
Optional. New version of a message that is known to the bot and was edited
sourcepub fn get_edited_message_ref<'a>(&'a self) -> Option<&'a Message>
pub fn get_edited_message_ref<'a>(&'a self) -> Option<&'a Message>
Optional. New version of a message that is known to the bot and was edited
sourcepub fn get_channel_post<'a>(&'a self) -> Option<Cow<'a, Message>>
pub fn get_channel_post<'a>(&'a self) -> Option<Cow<'a, Message>>
Optional. New incoming channel post of any kind - text, photo, sticker, etc.
sourcepub fn get_channel_post_ref<'a>(&'a self) -> Option<&'a Message>
pub fn get_channel_post_ref<'a>(&'a self) -> Option<&'a Message>
Optional. New incoming channel post of any kind - text, photo, sticker, etc.
sourcepub fn get_edited_channel_post<'a>(&'a self) -> Option<Cow<'a, Message>>
pub fn get_edited_channel_post<'a>(&'a self) -> Option<Cow<'a, Message>>
Optional. New version of a channel post that is known to the bot and was edited
sourcepub fn get_edited_channel_post_ref<'a>(&'a self) -> Option<&'a Message>
pub fn get_edited_channel_post_ref<'a>(&'a self) -> Option<&'a Message>
Optional. New version of a channel post that is known to the bot and was edited
sourcepub fn get_inline_query<'a>(&'a self) -> Option<Cow<'a, InlineQuery>>
pub fn get_inline_query<'a>(&'a self) -> Option<Cow<'a, InlineQuery>>
Optional. New incoming inline query
sourcepub fn get_inline_query_ref<'a>(&'a self) -> Option<&'a InlineQuery>
pub fn get_inline_query_ref<'a>(&'a self) -> Option<&'a InlineQuery>
Optional. New incoming inline query
sourcepub fn get_chosen_inline_result<'a>(
&'a self
) -> Option<Cow<'a, ChosenInlineResult>>
pub fn get_chosen_inline_result<'a>( &'a self ) -> Option<Cow<'a, ChosenInlineResult>>
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 get_chosen_inline_result_ref<'a>(
&'a self
) -> Option<&'a ChosenInlineResult>
pub fn get_chosen_inline_result_ref<'a>( &'a self ) -> Option<&'a ChosenInlineResult>
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 get_callback_query<'a>(&'a self) -> Option<Cow<'a, CallbackQuery>>
pub fn get_callback_query<'a>(&'a self) -> Option<Cow<'a, CallbackQuery>>
Optional. New incoming callback query
sourcepub fn get_callback_query_ref<'a>(&'a self) -> Option<&'a CallbackQuery>
pub fn get_callback_query_ref<'a>(&'a self) -> Option<&'a CallbackQuery>
Optional. New incoming callback query
sourcepub fn get_shipping_query<'a>(&'a self) -> Option<Cow<'a, ShippingQuery>>
pub fn get_shipping_query<'a>(&'a self) -> Option<Cow<'a, ShippingQuery>>
Optional. New incoming shipping query. Only for invoices with flexible price
sourcepub fn get_shipping_query_ref<'a>(&'a self) -> Option<&'a ShippingQuery>
pub fn get_shipping_query_ref<'a>(&'a self) -> Option<&'a ShippingQuery>
Optional. New incoming shipping query. Only for invoices with flexible price
sourcepub fn get_pre_checkout_query<'a>(&'a self) -> Option<Cow<'a, PreCheckoutQuery>>
pub fn get_pre_checkout_query<'a>(&'a self) -> Option<Cow<'a, PreCheckoutQuery>>
Optional. New incoming pre-checkout query. Contains full information about checkout
sourcepub fn get_pre_checkout_query_ref<'a>(&'a self) -> Option<&'a PreCheckoutQuery>
pub fn get_pre_checkout_query_ref<'a>(&'a self) -> Option<&'a PreCheckoutQuery>
Optional. New incoming pre-checkout query. Contains full information about checkout
sourcepub fn get_poll<'a>(&'a self) -> Option<Cow<'a, Poll>>
pub fn get_poll<'a>(&'a self) -> Option<Cow<'a, Poll>>
Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
sourcepub fn get_poll_ref<'a>(&'a self) -> Option<&'a Poll>
pub fn get_poll_ref<'a>(&'a self) -> Option<&'a Poll>
Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
sourcepub fn get_poll_answer<'a>(&'a self) -> Option<Cow<'a, PollAnswer>>
pub fn get_poll_answer<'a>(&'a self) -> Option<Cow<'a, PollAnswer>>
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 get_poll_answer_ref<'a>(&'a self) -> Option<&'a PollAnswer>
pub fn get_poll_answer_ref<'a>(&'a self) -> Option<&'a PollAnswer>
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 get_my_chat_member<'a>(&'a self) -> Option<Cow<'a, ChatMemberUpdated>>
pub fn get_my_chat_member<'a>(&'a self) -> Option<Cow<'a, ChatMemberUpdated>>
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 get_my_chat_member_ref<'a>(&'a self) -> Option<&'a ChatMemberUpdated>
pub fn get_my_chat_member_ref<'a>(&'a self) -> Option<&'a ChatMemberUpdated>
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 get_chat_member<'a>(&'a self) -> Option<Cow<'a, ChatMemberUpdated>>
pub fn get_chat_member<'a>(&'a self) -> Option<Cow<'a, ChatMemberUpdated>>
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 get_chat_member_ref<'a>(&'a self) -> Option<&'a ChatMemberUpdated>
pub fn get_chat_member_ref<'a>(&'a self) -> Option<&'a ChatMemberUpdated>
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 get_chat_join_request<'a>(&'a self) -> Option<Cow<'a, ChatJoinRequest>>
pub fn get_chat_join_request<'a>(&'a self) -> Option<Cow<'a, ChatJoinRequest>>
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.
sourcepub fn get_chat_join_request_ref<'a>(&'a self) -> Option<&'a ChatJoinRequest>
pub fn get_chat_join_request_ref<'a>(&'a self) -> Option<&'a ChatJoinRequest>
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.