1
私はlaravel 5.4とTelegram Bot SDKを使用しています。電報Bot SDK addコマンド
私のボットにコマンドを追加したいと思います。
StartCommand
をに追加しようとしましたが、エラーが発生します。
Command class "Vendor\App\Commands\StartCommand" not found!
が、ドキュメントは言う:
あなたがいる限り、あなたのコマンドは、あなたの
composer.json
設定
に基づいて自動的にロードすることができ、私はStartCommand class
を格納して任意のディレクトリにカスタムコマンドを格納することができます。 app\StartCommand.php
にあります。
は、ここに私のcomposer.json
です:で
...
,
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
...
ここ
あるtelegrom-BOT-SDKの設定の `config \ telegram.php:
...
'commands' => [
Telegram\Bot\Commands\HelpCommand::class,
Vendor\App\Commands\StartCommand::class,
],
];