tgbot-cpp
TgBot::EventBroadcaster Class Reference

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
 

Public Member Functions

void onAnyMessage (const MessageListener &listener)
 Registers listener which receives all messages which the bot can ever receive. More...
 
void onCommand (const std::string &commandName, const MessageListener &listener)
 Registers listener which receives all messages with commands (messages with leading '/' char). More...
 
void onCommand (const std::initializer_list< std::string > &commandsList, const MessageListener &listener)
 Registers listener which receives all messages with commands (messages with leading '/' char). More...
 
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. More...
 
void onNonCommandMessage (const MessageListener &listener)
 Registers listener which receives all messages without commands (messages with no leading '/' char) More...
 
void onInlineQuery (const InlineQueryListener &listener)
 Registers listener which receives all the inline query. More...
 
void onChosenInlineResult (const ChosenInlineResultListener &listener)
 Registers listener which receives all the chosen inline result. More...
 
void onCallbackQuery (const CallbackQueryListener &listener)
 

Detailed Description

This class holds all event listeners.

Definition at line 45 of file EventBroadcaster.h.

Member Typedef Documentation

Definition at line 53 of file EventBroadcaster.h.

Definition at line 52 of file EventBroadcaster.h.

Definition at line 51 of file EventBroadcaster.h.

typedef std::function<void (const Message::Ptr)> TgBot::EventBroadcaster::MessageListener

Definition at line 50 of file EventBroadcaster.h.

Member Function Documentation

void TgBot::EventBroadcaster::onAnyMessage ( const MessageListener listener)
inline

Registers listener which receives all messages which the bot can ever receive.

Parameters
listenerListener.

Definition at line 59 of file EventBroadcaster.h.

void TgBot::EventBroadcaster::onCallbackQuery ( const CallbackQueryListener listener)
inline

Definition at line 116 of file EventBroadcaster.h.

void TgBot::EventBroadcaster::onChosenInlineResult ( const ChosenInlineResultListener listener)
inline

Registers listener which receives all the chosen inline result.

Parameters
listenerListener.

Definition at line 112 of file EventBroadcaster.h.

void TgBot::EventBroadcaster::onCommand ( const std::string &  commandName,
const MessageListener listener 
)
inline

Registers listener which receives all messages with commands (messages with leading '/' char).

Parameters
commandNameCommand name which listener can handle.
listenerListener.

Definition at line 68 of file EventBroadcaster.h.

void TgBot::EventBroadcaster::onCommand ( const std::initializer_list< std::string > &  commandsList,
const MessageListener listener 
)
inline

Registers listener which receives all messages with commands (messages with leading '/' char).

Parameters
commandsListCommands names which listener can handle.
listenerListener.

Definition at line 77 of file EventBroadcaster.h.

void TgBot::EventBroadcaster::onInlineQuery ( const InlineQueryListener listener)
inline

Registers listener which receives all the inline query.

Parameters
listenerListener.

Definition at line 104 of file EventBroadcaster.h.

void TgBot::EventBroadcaster::onNonCommandMessage ( const MessageListener listener)
inline

Registers listener which receives all messages without commands (messages with no leading '/' char)

Parameters
listenerListener.

Definition at line 96 of file EventBroadcaster.h.

void TgBot::EventBroadcaster::onUnknownCommand ( const MessageListener listener)
inline

Registers listener which receives all messages with commands (messages with leading '/' char) which haven't been handled by other listeners.

Parameters
listenerListener.

Definition at line 88 of file EventBroadcaster.h.


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