Api icon indicating copy to clipboard operation
Api copied to clipboard

Resend after command "сс"

Open Leelter opened this issue 5 years ago • 2 comments

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;
});

Leelter avatar Dec 27 '20 21:12 Leelter

How do you try to use your command? Commands should be used as "/cc"

MyZik avatar Dec 28 '20 10:12 MyZik

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)

Leelter avatar Dec 30 '20 04:12 Leelter