|
| __construct (string $data, callable $script) |
| Add a function that will be executed everytime a callback query contains a string as data. More...
|
|
bool | checkCommand (array $callback_query) |
| (Internal) Process the callback query and check if it triggers a command of this type. More...
|
|
Public Member Functions inherited from PhpBotFramework\Commands\BasicCommand |
callable | getScript () |
|
◆ __construct()
PhpBotFramework\Commands\CallbackCommand::__construct |
( |
string |
$data, |
|
|
callable |
$script |
|
) |
| |
Add a function that will be executed everytime a callback query contains a string as data.
Use this syntax:
addMessageCommand("menu", function($bot, $callback_query) {
$bot->editMessageText($callback_query['message']['message_id'], "This is the menu"); });
- Parameters
-
string | $data | The string that will trigger this function. |
callable | $script | The function that will be triggered by the callback query if it contains the $data string. Must take an object(the bot) and an array(the callback query received). |
◆ checkCommand()
bool PhpBotFramework\Commands\CallbackCommand::checkCommand |
( |
array |
$callback_query | ) |
|
(Internal) Process the callback query and check if it triggers a command of this type.
- Parameters
-
array | $callback_query | Callback query to process. |
- Returns
- bool True if the callback query triggered a command.
The documentation for this class was generated from the following file:
- src/Commands/CallbackCommand.php