Cppgram
1.0.0
Easy and modern C++14 Telegram Bot API wrapper
|
Abstract class for bot commands. More...
#include <command.hpp>
Public Member Functions | |
virtual void | callClosure (T &, const types::Update &)=0 |
Forward the update to another function. More... | |
virtual bool | isValid (const types::Update &)=0 |
Does the update trigger this command? More... | |
Public Attributes | |
const EUpdate | type |
type of the update for which the command will be triggered. | |
Protected Member Functions | |
void | setInlineQueryId (std::string &inline_query_id, T &bot) |
Set the inline query id of the bot for using AnswerInlineQuery. More... | |
void | setCallbackQueryId (std::string &callback_query_id, T &bot) |
Set the callback query id the current update. More... | |
Abstract class for bot commands.
Command that will be triggered when some conditions are met in the current update. Inherit this class to implements behavior and condition that have to be met before triggering the command.
|
pure virtual |
Forward the update to another function.
When the update triggers this command, the current update will be forwarded to this method. Call the underlying pointer to a function using this method. Set also bot data(chat_id
, inline_query_id
, callback_query_id
) or some api methods will not work.
Implemented in MessageCommand< T >.
|
pure virtual |
Does the update trigger this command?
update | Current update to parse. |
Implemented in MessageCommand< T >.
|
inlineprotected |
Set the callback query id the current update.
callback_query_id | Id of the callback query received. |
bot | Bot that is processing the update. |
|
inlineprotected |
Set the inline query id of the bot for using AnswerInlineQuery.
inline_query_id | The id of the inline query received. |
bot | Bot that is processing the update. |