tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::Update Struct Reference

This object represents an incoming update. At most one of the optional parameters can be present in any given update. https://core.telegram.org/bots/api#update. More...

#include <Update.hpp>

Public Member Functions

 Update ()=default
 
 Update (const nl::json &json)
 
nl::json toJson () const
 Serializes this object to JSON. More...
 
void fromJson (const nl::json &json)
 Deserializes this object from JSON. More...
 

Public Attributes

std::int32_t updateId {}
 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. More...
 
Ptr< Messagemessage
 Optional. New incoming message of any kind — text, photo, sticker, etc. More...
 
Ptr< MessageeditedMessage
 Optional. New version of a message that is known to the bot and was edited. More...
 
Ptr< MessagechannelPost
 Optional. New incoming channel post of any kind — text, photo, sticker, etc. More...
 
Ptr< MessageeditedChannelPost
 Optional. New version of a channel post that is known to the bot and was edited. More...
 
Ptr< MessageReactionUpdatedmessageReaction
 Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. More...
 
Ptr< MessageReactionCountUpdatedmessageReactionCount
 Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes. More...
 
Ptr< InlineQueryinlineQuery
 Optional. New incoming inline query. More...
 
Ptr< ChosenInlineResultchosenInlineResult
 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. More...
 
Ptr< CallbackQuerycallbackQuery
 Optional. New incoming callback query. More...
 
Ptr< ShippingQueryshippingQuery
 Optional. New incoming shipping query. Only for invoices with flexible price. More...
 
Ptr< PreCheckoutQuerypreCheckoutQuery
 Optional. New incoming pre-checkout query. Contains full information about checkout. More...
 
Ptr< Pollpoll
 Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot. More...
 
Ptr< PollAnswerpollAnswer
 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. More...
 
Ptr< ChatMemberUpdatedmyChatMember
 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. More...
 
Ptr< ChatMemberUpdatedchatMember
 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. More...
 
Ptr< ChatJoinRequestchatJoinRequest
 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. More...
 
Ptr< ChatBoostUpdatedchatBoost
 Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. More...
 
Ptr< ChatBoostRemovedremovedChatBoost
 Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. More...
 

Detailed Description

This object represents an incoming update. At most one of the optional parameters can be present in any given update. https://core.telegram.org/bots/api#update.

Definition at line 22 of file Update.hpp.

Constructor & Destructor Documentation

◆ Update() [1/2]

tgbotxx::Update::Update ( )
default

◆ Update() [2/2]

tgbotxx::Update::Update ( const nl::json &  json)
inlineexplicit

Definition at line 24 of file Update.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::Update::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 121 of file Update.hpp.

◆ toJson()

nl::json tgbotxx::Update::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 96 of file Update.hpp.

Member Data Documentation

◆ callbackQuery

Ptr<CallbackQuery> tgbotxx::Update::callbackQuery

Optional. New incoming callback query.

Definition at line 65 of file Update.hpp.

◆ channelPost

Ptr<Message> tgbotxx::Update::channelPost

Optional. New incoming channel post of any kind — text, photo, sticker, etc.

Definition at line 42 of file Update.hpp.

◆ chatBoost

Ptr<ChatBoostUpdated> tgbotxx::Update::chatBoost

Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.

Definition at line 89 of file Update.hpp.

◆ chatJoinRequest

Ptr<ChatJoinRequest> tgbotxx::Update::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.

Definition at line 86 of file Update.hpp.

◆ chatMember

Ptr<ChatMemberUpdated> tgbotxx::Update::chatMember

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.

Definition at line 83 of file Update.hpp.

◆ chosenInlineResult

Ptr<ChosenInlineResult> tgbotxx::Update::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.

Definition at line 62 of file Update.hpp.

◆ editedChannelPost

Ptr<Message> tgbotxx::Update::editedChannelPost

Optional. New version of a channel post that is known to the bot and was edited.

Definition at line 45 of file Update.hpp.

◆ editedMessage

Ptr<Message> tgbotxx::Update::editedMessage

Optional. New version of a message that is known to the bot and was edited.

Definition at line 39 of file Update.hpp.

◆ inlineQuery

Ptr<InlineQuery> tgbotxx::Update::inlineQuery

Optional. New incoming inline query.

Definition at line 58 of file Update.hpp.

◆ message

Ptr<Message> tgbotxx::Update::message

Optional. New incoming message of any kind — text, photo, sticker, etc.

Definition at line 36 of file Update.hpp.

◆ messageReaction

Ptr<MessageReactionUpdated> tgbotxx::Update::messageReaction

Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.

Definition at line 50 of file Update.hpp.

◆ messageReactionCount

Ptr<MessageReactionCountUpdated> tgbotxx::Update::messageReactionCount

Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.

Definition at line 55 of file Update.hpp.

◆ myChatMember

Ptr<ChatMemberUpdated> tgbotxx::Update::myChatMember

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.

Definition at line 80 of file Update.hpp.

◆ poll

Ptr<Poll> tgbotxx::Update::poll

Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot.

Definition at line 74 of file Update.hpp.

◆ pollAnswer

Ptr<PollAnswer> tgbotxx::Update::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.

Definition at line 77 of file Update.hpp.

◆ preCheckoutQuery

Ptr<PreCheckoutQuery> tgbotxx::Update::preCheckoutQuery

Optional. New incoming pre-checkout query. Contains full information about checkout.

Definition at line 71 of file Update.hpp.

◆ removedChatBoost

Ptr<ChatBoostRemoved> tgbotxx::Update::removedChatBoost

Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.

Definition at line 92 of file Update.hpp.

◆ shippingQuery

Ptr<ShippingQuery> tgbotxx::Update::shippingQuery

Optional. New incoming shipping query. Only for invoices with flexible price.

Definition at line 68 of file Update.hpp.

◆ updateId

std::int32_t tgbotxx::Update::updateId {}

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.

Definition at line 33 of file Update.hpp.


The documentation for this struct was generated from the following file: