Skip to content

Resend after command "сс" #304

@Leelter

Description

@Leelter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions