botman / driver-telegram

BotMan Telegram Driver
MIT License
87 stars 75 forks source link

Telegram doesn't hear images. #68

Closed feralheart closed 2 years ago

feralheart commented 4 years ago
    $botman = $this->botman;

    $botman->hears('stop', function(BotMan $bot) {})->skipsConversation();

    $botman->receivesImages(function(BotMan $bot, $images) {
        foreach ($images as $image) {
            $url = $image->getUrl();
            $this->interpret($bot, $url, 'IMAGE');
        }
    });

   $botman->hears('{something}', function (BotMan $bot, $something) {
            $this->interpret($bot, $something, 'TEXT');
    });

    $botman->listen();

In the interpret() method I have a $bot->reply("I have a " . $messageType); where the $messageType is the third param of interpret() My problem is, that when I send a text from Telegram it replies me back the "I have a TEXT", but when I send an image I got a HTTP Status 200 in ngrok and next to it nothing happens. What am I missing?

tonkoshkurik commented 3 years ago

same here. it even no logs inside recevesImages closure $botman->receivesImages(function($bot, $images) { logger('receivesImages payload:' . $bot->getMessage()->getPayload());

tonkoshkurik commented 3 years ago

Found the solution: https://github.com/botman/botman/issues/712#issuecomment-659557072