Api
Api copied to clipboard
Resend after command "сс"
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;
});
How do you try to use your command? Commands should be used as "/cc"
How do you try to use your command? Commands should be used as "/cc"
After the command "cc" and the words Bot sent this word BUT only after the command
(i use google translate)