Skip to content

Launch other command on inline keyboard button click #251

Closed
@sigaev-pro

Description

@sigaev-pro

First of all thanks for great job!

I have created callbackquery command where I'm checking the callback_data for a string like "order:123".
I need to start an other command such as /reply 123.
But when I'm trying

return $this->telegram->executeCommand('reply 123');

I'm getting following exception:

PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getChat() on nul
l in /home/cargo/larabot/vendor/longman/telegram-bot/src/Commands/SystemCommands/GenericCommand.php:37
Stack trace:
#0 /home/cargo/larabot/vendor/longman/telegram-bot/src/Commands/Command.php(131): Longman\TelegramBot\Commands\SystemCommands\GenericCommand->execute()
#1 /home/cargo/larabot/vendor/longman/telegram-bot/src/Telegram.php(437): Longman\TelegramBot\Commands\Command->preExecute()
#2 /home/cargo/larabot/vendor/longman/telegram-bot/src/Telegram.php(428): Longman\TelegramBot\Telegram->executeCommand('Generic')
#3 /home/cargo/larabot/commands/CallbackqueryCommand.php(53): Longman\TelegramBot\Telegram->executeCommand('oreply 18')
#4 /home/cargo/larabot/vendor/longman/telegram-bot/src/Commands/Command.php(131): Longman\TelegramBot\Commands\SystemCommands\CallbackqueryCommand->execute()
#5 /home/cargo/larabot/vendor/longman/telegram-bot/src/Telegram.php(437): Longman\TelegramBot\Commands\Command->preExecute()

Does it a way to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions