tgbot-cpp
|
This class holds all event listeners. More...
#include <EventBroadcaster.h>
Public Types | |
typedef std::function< void(const Message::Ptr)> | MessageListener |
typedef std::function< void(const InlineQuery::Ptr)> | InlineQueryListener |
typedef std::function< void(const ChosenInlineResult::Ptr)> | ChosenInlineResultListener |
typedef std::function< void(const CallbackQuery::Ptr)> | CallbackQueryListener |
typedef std::function< void(const ShippingQuery::Ptr)> | ShippingQueryListener |
typedef std::function< void(const PreCheckoutQuery::Ptr)> | PreCheckoutQueryListener |
typedef std::function< void(const Poll::Ptr)> | PollListener |
typedef std::function< void(const PollAnswer::Ptr)> | PollAnswerListener |
typedef std::function< void(const ChatMemberUpdated::Ptr)> | ChatMemberUpdatedListener |
typedef std::function< void(const ChatJoinRequest::Ptr)> | ChatJoinRequestListener |
Public Member Functions | |
void | onAnyMessage (const MessageListener &listener) |
Registers listener which receives new incoming message of any kind - text, photo, sticker, etc. | |
void | onCommand (const std::string &commandName, const MessageListener &listener) |
Registers listener which receives all messages with commands (messages with leading '/' char). | |
void | onCommand (const std::initializer_list< std::string > &commandsList, const MessageListener &listener) |
Registers listener which receives all messages with commands (messages with leading '/' char). | |
void | onUnknownCommand (const MessageListener &listener) |
Registers listener which receives all messages with commands (messages with leading '/' char) which haven't been handled by other listeners. | |
void | onNonCommandMessage (const MessageListener &listener) |
Registers listener which receives all messages without commands (messages with no leading '/' char) | |
void | onEditedMessage (const MessageListener &listener) |
Registers listener which receives new versions of a message that is known to the bot and was edited. | |
void | onInlineQuery (const InlineQueryListener &listener) |
Registers listener which receives new incoming inline queries. | |
void | onChosenInlineResult (const ChosenInlineResultListener &listener) |
Registers listener which receives the results of an inline query that was chosen by a user and sent to their chat partner. Please see https://core.telegram.org/bots/inline#collecting-feedback for details on how to enable these updates for your bot. | |
void | onCallbackQuery (const CallbackQueryListener &listener) |
Registers listener which receives new incoming callback queries. | |
void | onShippingQuery (const ShippingQueryListener &listener) |
Registers listener which receives new incoming shipping queries. Only for invoices with flexible price. | |
void | onPreCheckoutQuery (const PreCheckoutQueryListener &listener) |
Registers listener which receives new incoming pre-checkout queries. Contains full information about checkout. | |
void | onPoll (const PollListener &listener) |
Registers listener which receives new poll states. Bots receive only updates about stopped polls and polls, which are sent by the bot. | |
void | onPollAnswer (const PollAnswerListener &listener) |
Registers listener which receives an answer if a user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. | |
void | onMyChatMember (const ChatMemberUpdatedListener &listener) |
Registers listener which receives the bot's chat member status if it was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. | |
void | onChatMember (const ChatMemberUpdatedListener &listener) |
Registers listener which receives a status if 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. | |
void | onChatJoinRequest (const ChatJoinRequestListener &listener) |
Registers listener which receives requests to join the chat. The bot must have the canInviteUsers administrator right in the chat to receive these updates. | |
This class holds all event listeners.
Definition at line 31 of file EventBroadcaster.h.
typedef std::function<void (const CallbackQuery::Ptr)> TgBot::EventBroadcaster::CallbackQueryListener |
Definition at line 39 of file EventBroadcaster.h.
typedef std::function<void (const ChatJoinRequest::Ptr)> TgBot::EventBroadcaster::ChatJoinRequestListener |
Definition at line 45 of file EventBroadcaster.h.
typedef std::function<void (const ChatMemberUpdated::Ptr)> TgBot::EventBroadcaster::ChatMemberUpdatedListener |
Definition at line 44 of file EventBroadcaster.h.
typedef std::function<void (const ChosenInlineResult::Ptr)> TgBot::EventBroadcaster::ChosenInlineResultListener |
Definition at line 38 of file EventBroadcaster.h.
typedef std::function<void (const InlineQuery::Ptr)> TgBot::EventBroadcaster::InlineQueryListener |
Definition at line 37 of file EventBroadcaster.h.
typedef std::function<void (const Message::Ptr)> TgBot::EventBroadcaster::MessageListener |
Definition at line 36 of file EventBroadcaster.h.
typedef std::function<void (const PollAnswer::Ptr)> TgBot::EventBroadcaster::PollAnswerListener |
Definition at line 43 of file EventBroadcaster.h.
typedef std::function<void (const Poll::Ptr)> TgBot::EventBroadcaster::PollListener |
Definition at line 42 of file EventBroadcaster.h.
typedef std::function<void (const PreCheckoutQuery::Ptr)> TgBot::EventBroadcaster::PreCheckoutQueryListener |
Definition at line 41 of file EventBroadcaster.h.
typedef std::function<void (const ShippingQuery::Ptr)> TgBot::EventBroadcaster::ShippingQueryListener |
Definition at line 40 of file EventBroadcaster.h.
|
inline |
Registers listener which receives new incoming message of any kind - text, photo, sticker, etc.
listener | Listener. |
Definition at line 51 of file EventBroadcaster.h.
|
inline |
Registers listener which receives new incoming callback queries.
listener | Listener. |
Definition at line 131 of file EventBroadcaster.h.
|
inline |
Registers listener which receives requests to join the chat. The bot must have the canInviteUsers administrator right in the chat to receive these updates.
listener | Listener. |
Definition at line 201 of file EventBroadcaster.h.
|
inline |
Registers listener which receives a status if 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.
listener | Listener. |
Definition at line 191 of file EventBroadcaster.h.
|
inline |
Registers listener which receives the results of an inline query that was chosen by a user and sent to their chat partner. Please see https://core.telegram.org/bots/inline#collecting-feedback for details on how to enable these updates for your bot.
listener | Listener. |
Definition at line 123 of file EventBroadcaster.h.
|
inline |
Registers listener which receives all messages with commands (messages with leading '/' char).
commandsList | Commands names which listener can handle. |
listener | Listener. Pass nullptr to remove listener of commands |
Definition at line 73 of file EventBroadcaster.h.
|
inline |
Registers listener which receives all messages with commands (messages with leading '/' char).
commandName | Command name which listener can handle. |
listener | Listener. Pass nullptr to remove listener of command |
Definition at line 60 of file EventBroadcaster.h.
|
inline |
Registers listener which receives new versions of a message that is known to the bot and was edited.
listener | Listener. |
Definition at line 105 of file EventBroadcaster.h.
|
inline |
Registers listener which receives new incoming inline queries.
listener | Listener. |
Definition at line 113 of file EventBroadcaster.h.
|
inline |
Registers listener which receives the bot's chat member status if it was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
listener | Listener. |
Definition at line 181 of file EventBroadcaster.h.
|
inline |
Registers listener which receives all messages without commands (messages with no leading '/' char)
listener | Listener. |
Definition at line 97 of file EventBroadcaster.h.
|
inline |
Registers listener which receives new poll states. Bots receive only updates about stopped polls and polls, which are sent by the bot.
listener | Listener. |
Definition at line 161 of file EventBroadcaster.h.
|
inline |
Registers listener which receives an answer if a user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
listener | Listener. |
Definition at line 171 of file EventBroadcaster.h.
|
inline |
Registers listener which receives new incoming pre-checkout queries. Contains full information about checkout.
listener | Listener. |
Definition at line 151 of file EventBroadcaster.h.
|
inline |
Registers listener which receives new incoming shipping queries. Only for invoices with flexible price.
listener | Listener. |
Definition at line 141 of file EventBroadcaster.h.
|
inline |
Registers listener which receives all messages with commands (messages with leading '/' char) which haven't been handled by other listeners.
listener | Listener. |
Definition at line 89 of file EventBroadcaster.h.