Telegram Bot SDK add command

Viewed 854

I am using laravel 5.4 and Telegram Bot SDK.

I want to add a command to my bot.

I try to add StartCommand of the documentation but I get error.

Command class "Vendor\App\Commands\StartCommand" not found!

but the documentation says:

You may store your custom commands in any directory as long as your commands can be autoloaded based on your composer.json settings

and I store StartCommand class in app\StartCommand.php.

here is my composer.json:

...
,
"autoload": {
    "classmap": [
      "database"
    ],
    "psr-4": {
      "App\\": "app/"
    }
},
...

here is telegrom-bot-sdk config at `config\telegram.php:

...
    'commands' => [
        Telegram\Bot\Commands\HelpCommand::class,
        Vendor\App\Commands\StartCommand::class,
    ],
];
1 Answers
Related