tgbotxx
1.1.6.9
Telegram Bot C++ Library
|
#include <Bot.hpp>
Public Member Functions | |
Bot (const std::string &token) | |
Constructs a new Bot object. More... | |
~Bot () | |
void | start () |
Start the long polling. More... | |
void | stop () |
Stop the long polling. More... | |
virtual void | onStart () |
Called before Bot starts receiving updates (triggered by Bot::start()) Use this callback to initialize your code, set commands.. More... | |
virtual void | onStop () |
Called when Bot is about to be stopped (triggered by Bot::stop()) Cleanup your code in this callback (close handles, backup data...) More... | |
virtual void | onAnyMessage (const Ptr< Message > &message) |
Called when a new message is received of any kind - text, photo, sticker, etc. More... | |
virtual void | onNonCommandMessage (const Ptr< Message > &message) |
Called when a non-command message is received of any kind - text, photo, sticker, etc. More... | |
virtual void | onCommand (const Ptr< Message > &command) |
Called when a new command is received (messages with leading '/' char). More... | |
virtual void | onUnknownCommand (const Ptr< Message > &message) |
Called when an unknown command is received (messages with leading '/' char). More... | |
virtual void | onEditedMessage (const Ptr< Message > &editedMessage) |
Called when a new version of a message that is known to the bot and was edited. More... | |
virtual void | onMessageReactionUpdated (const Ptr< MessageReactionUpdated > &messageReaction) |
Called when a reaction to a message was changed by a user. More... | |
virtual void | onMessageReactionCountUpdated (const Ptr< MessageReactionCountUpdated > &messageReactionCount) |
Called when reactions to a message with anonymous reactions were changed. More... | |
virtual void | onInlineQuery (const Ptr< InlineQuery > &inlineQuery) |
Called when a new incoming inline query is received. More... | |
virtual void | onChosenInlineResult (const Ptr< ChosenInlineResult > &chosenInlineResult) |
Called when the result of an inline query that was chosen by a user and sent to their chat partner. More... | |
virtual void | onCallbackQuery (const Ptr< CallbackQuery > &callbackQuery) |
Called when a new incoming callback query is received. More... | |
virtual void | onShippingQuery (const Ptr< ShippingQuery > &shippingQuery) |
Called when a new incoming shipping query is received. More... | |
virtual void | onPreCheckoutQuery (const Ptr< PreCheckoutQuery > &preCheckoutQuery) |
Called when a new incoming pre-checkout query is received. Contains full information about checkout. More... | |
virtual void | onPoll (const Ptr< Poll > &poll) |
Called when a new poll state is received. More... | |
virtual void | onPollAnswer (const Ptr< PollAnswer > &pollAnswer) |
Called when a user changed their answer in a non-anonymous poll. More... | |
virtual void | onMyChatMember (const Ptr< ChatMemberUpdated > &myChatMemberUpdated) |
Called when the bot's chat member status was updated in a chat. More... | |
virtual void | onChatMember (const Ptr< ChatMemberUpdated > &chatMemberUpdated) |
Called when a chat member's status was updated in a chat. More... | |
virtual void | onChatJoinRequest (const Ptr< ChatJoinRequest > &chatJoinRequest) |
Called when a request to join the chat has been sent. More... | |
virtual void | onChatBoostUpdated (const Ptr< ChatBoostUpdated > &chatBoostUpdated) |
Called when a chat boost was added or changed. More... | |
virtual void | onChatBoostRemoved (const Ptr< ChatBoostRemoved > &chatBoostRemoved) |
Called when a boost was removed from a chat. More... | |
virtual void | onLongPollError (const std::string &errorMessage, ErrorCode errorCode) |
Called when the long polling getUpdates fails. More... | |
Protected Member Functions | |
const Ptr< Api > & | getApi () const noexcept |
Returns Api object. More... | |
const Ptr< Api > & | api () const noexcept |
Returns Api object. More... | |
bool | isRunning () const noexcept |
Returns true if the Bot long polling is currently running. More... | |
|
explicit |
tgbotxx::Bot::~Bot | ( | ) |
|
protectednoexcept |
Returns true if the Bot long polling is currently running.
|
inlinevirtual |
Called when a new incoming callback query is received.
callbackQuery | CallbackQuery object |
|
inlinevirtual |
Called when a boost was removed from a chat.
chatBoostRemoved | ChatBoostRemoved object |
|
inlinevirtual |
Called when a chat boost was added or changed.
chatBoostUpdated | ChatBoostUpdated object |
|
inlinevirtual |
Called when a request to join the chat has been sent.
chatJoinRequest | ChatJoinRequest object |
|
inlinevirtual |
Called when a chat member's status was updated in a chat.
chatMemberUpdated | ChatMemberUpdated object |
|
inlinevirtual |
Called when the result of an inline query that was chosen by a user and sent to their chat partner.
chosenInlineResult | ChosenInlineResult object |
|
inlinevirtual |
Called when a new incoming inline query is received.
inlineQuery | InlineQuery object |
|
inlinevirtual |
|
inlinevirtual |
Called when reactions to a message with anonymous reactions were changed.
messageReactionCount | MessageReactionCountUpdated object |
|
inlinevirtual |
Called when a reaction to a message was changed by a user.
messageReaction | MessageReactionUpdated object |
|
inlinevirtual |
Called when the bot's chat member status was updated in a chat.
myChatMemberUpdated | ChatMemberUpdated object |
|
inlinevirtual |
Called when a user changed their answer in a non-anonymous poll.
pollAnswer | PollAnswer object |
|
inlinevirtual |
Called when a new incoming pre-checkout query is received. Contains full information about checkout.
preCheckoutQuery | PreCheckoutQuery object |
|
inlinevirtual |
Called when a new incoming shipping query is received.
shippingQuery | ShippingQuery object |
|
inlinevirtual |
Called before Bot starts receiving updates (triggered by Bot::start()) Use this callback to initialize your code, set commands..
Bot Callbacks
|
inlinevirtual |
Called when Bot is about to be stopped (triggered by Bot::stop()) Cleanup your code in this callback (close handles, backup data...)
void tgbotxx::Bot::start | ( | ) |
Start the long polling.
Exception | on failure |
void tgbotxx::Bot::stop | ( | ) |
Stop the long polling.