![]() |
PhpBotFramework
2.0.2
A framework for Telegram Bots' APIs.
|
Public Member Functions | |
| __construct (string $command, callable $script, array $ids) | |
| Registers commands that can be triggered only by administrators. More... | |
| bool | checkCommand (array $message) |
Public Member Functions inherited from PhpBotFramework\Commands\MessageCommand | |
| __construct (string $command, callable $script) | |
| Add a function that will be executed everytime a message contain the selected command. More... | |
| bool | checkCommand (array $message) |
Public Member Functions inherited from PhpBotFramework\Commands\BasicCommand | |
| callable | getScript () |
Static Public Attributes | |
| static | $type = 'message' |
| static | $object_class = 'PhpBotFramework\Entities\Message' |
| static | $priority = 1 |
Static Public Attributes inherited from PhpBotFramework\Commands\MessageCommand | |
| static | $type = 'message' |
| static | $object_class = 'PhpBotFramework\Entities\Message' |
| static | $priority = 1 |
Additional Inherited Members | |
Protected Attributes inherited from PhpBotFramework\Commands\BasicCommand | |
| $script | |
| PhpBotFramework\Commands\AdminCommand::__construct | ( | string | $command, |
| callable | $script, | ||
| array | $ids | ||
| ) |
Registers commands that can be triggered only by administrators.
It works like MessageCommand but it requires a third argument: the list of Telegram IDs which represents the users that can execute the command.
$start_command = new PhpBotFramework\Commands\AdminCommand("getusers",
function ($bot, $message) {
$bot->sendMessage("Hello, folks!");
},
array(3299130043, -439991220, 12221004));
| string | $command | The command that will trigger this function (e.g. start) |
| callable | $script | The function that will be triggered by a command. |
| array | $ids | The users who can execute the command. Must take an object(the bot) and an array(the message received). |
1.8.13