jeudi 27 février 2020

Laravel Botman: Can't send anything but texts

  • BotMan Version: 2.5
  • PHP Version: 7.2.28
  • Messaging Service(s): Telegram, Facebook
  • Cache Driver: LaravelCache

I wanted to integrate Botman to one of my Laravel projects, but when I want to send for example image like in the documentation:

    $attachment = new Image('https://thenextdoor.org/wp-content/uploads/2016/11/placeholder-815x458.png');

    $message = OutgoingMessage::create('foo')
                ->withAttachment($attachment);

    // Reply message object
    $bot->reply($message);

It doesn't send anything and no log was generated. I implemented the bot like this:

 $config['telegram']['token'] = env('TELEGRAM_TOKEN');
 DriverManager::loadDriver(TelegramDriver::class);

 $bot = BotManFactory::create($config, new LaravelCache());

And it's working with base text messages, but if I want to send or receive an attachment somewhy it doesn't works.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire