-
Notifications
You must be signed in to change notification settings - Fork 339
Open
Labels
Description
How to use this script so that it only works after the "cc" command
Ie I want him to send me a message too only after the command "сс".
This script works:
$bot->on(function (\TelegramBot\Api\Types\Update $update) use ($bot) {
$message = $update->getMessage();
$id = $message->getChat()->getId();
$bot->sendMessage($id, $message->getText());
}, function () {
return true;
});
But I want it this way but it doesn't work:
$bot->command('cc', on(function (\TelegramBot\Api\Types\Update $update) use ($bot)) {
$message = $update->getMessage();
$id = $message->getChat()->getId();
$bot->sendMessage($id, $message->getText());
}, function () {
return true;
});