tgbot-cpp
Loading...
Searching...
No Matches
TgBot::Update Class Reference

This object represents an incoming update. More...

#include <Update.h>

Public Types

typedef std::shared_ptr< UpdatePtr
 

Public Attributes

std::int32_t updateId
 The update's unique identifier.
 
Message::Ptr message
 Optional. New incoming message of any kind - text, photo, sticker, etc.
 
Message::Ptr editedMessage
 Optional. New version of a message that is known to the bot and was edited.
 
Message::Ptr channelPost
 Optional. New incoming channel post of any kind - text, photo, sticker, etc.
 
Message::Ptr editedChannelPost
 Optional. New version of a channel post that is known to the bot and was edited.
 
BusinessConnection::Ptr businessConnection
 Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot.
 
Message::Ptr businessMessage
 Optional. New non-service message from a connected business account.
 
Message::Ptr editedBusinessMessage
 Optional. New version of a message from a connected business account.
 
BusinessMessagesDeleted::Ptr deletedBusinessMessages
 Optional. Messages were deleted from a connected business account.
 
MessageReactionUpdated::Ptr messageReaction
 Optional. A reaction to a message was changed by a user.
 
MessageReactionCountUpdated::Ptr messageReactionCount
 Optional. Reactions to a message with anonymous reactions were changed.
 
InlineQuery::Ptr inlineQuery
 Optional. New incoming inline query.
 
ChosenInlineResult::Ptr chosenInlineResult
 Optional. The result of an inline query that was chosen by a user and sent to their chat partner.
 
CallbackQuery::Ptr callbackQuery
 Optional. New incoming callback query.
 
ShippingQuery::Ptr shippingQuery
 Optional. New incoming shipping query.
 
PreCheckoutQuery::Ptr preCheckoutQuery
 Optional. New incoming pre-checkout query.
 
Poll::Ptr poll
 Optional. New poll state.
 
PollAnswer::Ptr pollAnswer
 Optional. A user changed their answer in a non-anonymous poll.
 
ChatMemberUpdated::Ptr myChatMember
 Optional. The bot's chat member status was updated in a chat.
 
ChatMemberUpdated::Ptr chatMember
 Optional. A chat member's status was updated in a chat.
 
ChatJoinRequest::Ptr chatJoinRequest
 Optional. A request to join the chat has been sent.
 
ChatBoostUpdated::Ptr chatBoost
 Optional. A chat boost was added or changed.
 
ChatBoostRemoved::Ptr removedChatBoost
 Optional. A boost was removed from a chat.
 

Detailed Description

This object represents an incoming update.

At most one of the optional parameters can be present in any given update.

Definition at line 33 of file Update.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Update> TgBot::Update::Ptr

Definition at line 36 of file Update.h.

Member Data Documentation

◆ businessConnection

BusinessConnection::Ptr TgBot::Update::businessConnection

Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot.

Definition at line 74 of file Update.h.

◆ businessMessage

Message::Ptr TgBot::Update::businessMessage

Optional. New non-service message from a connected business account.

Definition at line 79 of file Update.h.

◆ callbackQuery

CallbackQuery::Ptr TgBot::Update::callbackQuery

Optional. New incoming callback query.

Definition at line 122 of file Update.h.

◆ channelPost

Message::Ptr TgBot::Update::channelPost

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

Definition at line 62 of file Update.h.

◆ chatBoost

ChatBoostUpdated::Ptr TgBot::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 178 of file Update.h.

◆ chatJoinRequest

ChatJoinRequest::Ptr TgBot::Update::chatJoinRequest

Optional. A request to join the chat has been sent.

The bot must have the canInviteUsers administrator right in the chat to receive these updates.

Definition at line 171 of file Update.h.

◆ chatMember

ChatMemberUpdated::Ptr TgBot::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 allowedUpdates to receive these updates.

Definition at line 164 of file Update.h.

◆ chosenInlineResult

ChosenInlineResult::Ptr TgBot::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 117 of file Update.h.

◆ deletedBusinessMessages

BusinessMessagesDeleted::Ptr TgBot::Update::deletedBusinessMessages

Optional. Messages were deleted from a connected business account.

Definition at line 89 of file Update.h.

◆ editedBusinessMessage

Message::Ptr TgBot::Update::editedBusinessMessage

Optional. New version of a message from a connected business account.

Definition at line 84 of file Update.h.

◆ editedChannelPost

Message::Ptr TgBot::Update::editedChannelPost

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

This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.

Definition at line 69 of file Update.h.

◆ editedMessage

Message::Ptr TgBot::Update::editedMessage

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

This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.

Definition at line 57 of file Update.h.

◆ inlineQuery

InlineQuery::Ptr TgBot::Update::inlineQuery

Optional. New incoming inline query.

Definition at line 110 of file Update.h.

◆ message

Message::Ptr TgBot::Update::message

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

Definition at line 50 of file Update.h.

◆ messageReaction

MessageReactionUpdated::Ptr TgBot::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 allowedUpdates to receive these updates. The update isn't received for reactions set by bots.

Definition at line 97 of file Update.h.

◆ messageReactionCount

MessageReactionCountUpdated::Ptr TgBot::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 allowedUpdates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.

Definition at line 105 of file Update.h.

◆ myChatMember

ChatMemberUpdated::Ptr TgBot::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 157 of file Update.h.

◆ poll

Poll::Ptr TgBot::Update::poll

Optional. New poll state.

Bots receive only updates about manually stopped polls and polls, which are sent by the bot

Definition at line 143 of file Update.h.

◆ pollAnswer

PollAnswer::Ptr TgBot::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 150 of file Update.h.

◆ preCheckoutQuery

PreCheckoutQuery::Ptr TgBot::Update::preCheckoutQuery

Optional. New incoming pre-checkout query.

Contains full information about checkout

Definition at line 136 of file Update.h.

◆ removedChatBoost

ChatBoostRemoved::Ptr TgBot::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 185 of file Update.h.

◆ shippingQuery

ShippingQuery::Ptr TgBot::Update::shippingQuery

Optional. New incoming shipping query.

Only for invoices with flexible price

Definition at line 129 of file Update.h.

◆ updateId

std::int32_t TgBot::Update::updateId

The update's unique identifier.

Update identifiers start from a certain positive number and increase sequentially. This identifier 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 45 of file Update.h.


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