Cppgram
1.0.0
Easy and modern C++14 Telegram Bot API wrapper
|
Triggered by bot command in messages. More...
#include <message_command.hpp>
Public Member Functions | |
MessageCommand (std::string &command, MessageClosure script) | |
Construct a message command. More... | |
virtual void | callClosure (T &bot, const types::Update &update) |
Forward the update to another function. More... | |
virtual bool | isValid (const types::Update &update) |
Does the update trigger this command? More... | |
Additional Inherited Members | |
Public Attributes inherited from Command< T > | |
const EUpdate | type |
type of the update for which the command will be triggered. | |
Protected Member Functions inherited from Command< T > | |
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... | |
Triggered by bot command in messages.
If the message contains a bot command and it is the same as this command, call the underlying function. This command will be triggered only if the command is the first to appear in the message.
|
inline |
Construct a message command.
command | String that has to appear in the bot command to trigger this object. If you want the bot to trigger on the command /start, pass "start" as command parameter. |
script | The function that will be called if this command is triggered. |
|
inlinevirtual |
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.
Implements Command< T >.
|
inlinevirtual |
Does the update trigger this command?
update | Current update to parse. |
Implements Command< T >.