1 #include "cppgram/command_handler.hpp" 2 #include "cppgram/commands/command.hpp" 3 #include "cppgram/types/update.hpp" 8 using cppgram::types::Update;
27 , commands( c.commands )
34 , commands( c.commands )
44 commands = c.commands;
53 owner = std::move( c.owner );
54 commands = std::move( c.commands );
63 commands[new_command->
type].push_back( new_command );
70 commands = c.commands;
90 if ( c->isValid( update ) )
92 c->callClosure( *owner, update );
const EUpdate type
type of the update for which the command will be triggered.
Definition: command.hpp:32
void addCommand(commands::Command< T > *new_command)
Add a bot command.
Definition: command_handler_impl.hpp:61
void init(T *bot)
Check if this object has an owner and set it to bot if not.
Definition: command_handler_impl.hpp:75
CommandHandler & operator=(const CommandHandler &c)
Assigment constructor.
Definition: command_handler_impl.hpp:40
Handle bot commands.
Definition: command_handler.hpp:26
void setCommands(const CommandHandler &c)
copy commands of another object of type CommandHandler
Definition: command_handler_impl.hpp:68
contains api methods, update handlers and listener.
Definition: basic_bot.hpp:199
Abstract class for bot commands.
Definition: command_handler.hpp:15
CommandHandler()
Empty object.
Definition: command_handler_impl.hpp:13