◆ __construct()
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));
- Parameters
-
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). |
The documentation for this class was generated from the following file:
- src/Commands/AdminCommand.php