Je crée un télégramme bot avec laravel et sdk. Tout fonctionne bien. Comment puis-je ajouter un autre bot dans la même application? Dans app/Http/Middleware/VerifyCsrfToken.php
ajouterPlusieurs bots dans une application
protected $except = [
'437198700:XXXXXXXXXXXXXX_YYYYY/webhook'
];
pour le premier bot. Et en app/config/telegram.php
'bot_token' => '437198700:XXXXXXXXXXXXXX_YYYYY',
. J'ajoute cette config mais même problème
`return [
// 'default' => 'common',
'bots' => [
'common' => [
'username' => 'MyTelegramBot',
'token' => env('TELEGRAM_BOT_TOKEN'),
'commands' => [
// Acme\Project\Commands\MyTelegramBot\BotCommand::class
],
],
'second' => [
'username' => 'MySecondBot',
'token' => env('TELEGRAM_MANAGER_BOT_TOKEN'),
],
],
Upd: ajouter cette $bots_manager= new BotsManager($config);
$ config ressembler config j'essaie d'appeler $bots_manager = $bots_manager->bot('second');
Retour erreur Bot [second] not configured.
Qu'est-ce que je fais mal?
Demandez auteur au lieu de demander ici. – Sean
Si vous regardez [fichier de configuration de telegram.php] (https://github.com/irazasyed/telegram-bot-sdk/blob/master/src/Laravel/config/telegram.php) vous pouvez voir ''bots' => [... '. Utilisez cela pour ajouter plusieurs robots. Je ne vois pas non plus 'bot_token' là ... – ljubadr
@ljubadr Je modifie ma config comme dans l'exemple mais j'ai toujours le même problème. – sandy