24 explicit Update(
const nl::json& json) {
97 nl::json json = nl::json::object();
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
This object represents an incoming update. At most one of the optional parameters can be present in a...
Ptr< Message > message
Optional. New incoming message of any kind — text, photo, sticker, etc.
Ptr< ChatMemberUpdated > myChatMember
Optional. The bot's chat member status was updated in a chat. For private chats, this update is recei...
Ptr< Message > channelPost
Optional. New incoming channel post of any kind — text, photo, sticker, etc.
Ptr< MessageReactionCountUpdated > messageReactionCount
Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administra...
nl::json toJson() const
Serializes this object to JSON.
Ptr< ChatJoinRequest > chatJoinRequest
Optional. A request to join the chat has been sent. The bot must have the can_invite_users administra...
Ptr< ShippingQuery > shippingQuery
Optional. New incoming shipping query. Only for invoices with flexible price.
Ptr< PollAnswer > pollAnswer
Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls t...
Ptr< ChatMemberUpdated > chatMember
Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat ...
Ptr< Message > editedChannelPost
Optional. New version of a channel post that is known to the bot and was edited.
Ptr< ChatBoostRemoved > removedChatBoost
Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive th...
void fromJson(const nl::json &json)
Deserializes this object from JSON.
Ptr< Message > editedMessage
Optional. New version of a message that is known to the bot and was edited.
Ptr< MessageReactionUpdated > messageReaction
Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat...
Ptr< InlineQuery > inlineQuery
Optional. New incoming inline query.
Ptr< PreCheckoutQuery > preCheckoutQuery
Optional. New incoming pre-checkout query. Contains full information about checkout.
Ptr< ChatBoostUpdated > chatBoost
Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive ...
Update(const nl::json &json)
Ptr< CallbackQuery > callbackQuery
Optional. New incoming callback query.
Ptr< Poll > poll
Optional. New poll state. Bots receive only updates about stopped polls and polls,...
Ptr< ChosenInlineResult > chosenInlineResult
Optional. The result of an inline query that was chosen by a user and sent to their chat partner....
std::int32_t updateId
The update's unique identifier. Update identifiers start from a certain positive number and increase ...