Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use SendMediaGroup method #75

Closed
eliosh opened this issue Jan 4, 2018 · 3 comments
Closed

Unable to use SendMediaGroup method #75

eliosh opened this issue Jan 4, 2018 · 3 comments
Assignees
Labels

Comments

@eliosh
Copy link

eliosh commented Jan 4, 2018

I can't send media group.

Here is the code that gave me error:

` ...

  $m = new SendMediaGroup();
  $m->chat_id = $update->message->chat->id;
  foreach($cursor as $item){
    $photo = new Photo();
    $photo->media = "https://REALURL.EXT/medium/public{$item['_id']}";
    $m->media[] = $photo;
  }

`

But if I try to send single photos, with

` ...

foreach($cursor as $item){
    $m = new SendPhoto();
    $m->chat_id = $update->message->chat->id;
    $m->photo = "https://REALURL.EXT/medium/public{$item['_id']}";

}
`
it works perfectly.

I hope the info I gave is useful :-)

This is the error:
[2018-01-04 22:00:50] MegaBotMain.ERROR: unreal4u\TelegramAPI\Exceptions\ClientException: Bad Request: media to send are not specified in /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/unreal4u/telegram-api/src/InternalFunctionality/TelegramResponse.php:50 Stack trace: #0 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/unreal4u/telegram-api/src/InternalFunctionality/TelegramResponse.php(33): unreal4u\TelegramAPI\InternalFunctionality\TelegramResponse->fillRawData('{"ok":false,"er...') #1 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/unreal4u/telegram-api/src/HttpClientRequestHandler.php(73): unreal4u\TelegramAPI\InternalFunctionality\TelegramResponse->__construct('{"ok":false,"er...', Array) #2 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): unreal4u\TelegramAPI\HttpClientRequestHandler->unreal4u\TelegramAPI\{closure}() #3 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/react/http-client/src/Response.php(92): Evenement\EventEmitter->emit('end') #4 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\HttpClient\Response->handleEnd() #5 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/react/stream/src/Util.php(71): Evenement\EventEmitter->emit('end', Array) #6 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Stream\Util::React\Stream\{closure}() #7 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/react/stream/src/DuplexResourceStream.php(196): Evenement\EventEmitter->emit('end') #8 [internal function]: React\Stream\DuplexResourceStream->handleData(Resource id #144, Object(React\EventLoop\StreamSelectLoop)) #9 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/react/event-loop/src/StreamSelectLoop.php(236): call_user_func(Array, Resource id #144, Object(React\EventLoop\StreamSelectLoop)) #10 /home/eliosh/PhpstormProjects/MegaBot/megabot/vendor/react/event-loop/src/StreamSelectLoop.php(205): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL) #11 /home/eliosh/PhpstormProjects/MegaBot/megabot/src/MegaMain.php(68): React\EventLoop\StreamSelectLoop->run() #12 /home/eliosh/PhpstormProjects/MegaBot/megabot/main.php(19): MegaBot7\MegaMain->process() #13 {main} [] []

@unreal4u unreal4u self-assigned this Jan 4, 2018
@unreal4u unreal4u added the bug label Jan 4, 2018
@unreal4u
Copy link
Owner

unreal4u commented Jan 4, 2018

The stack trace will be certainly a lot of help!

Will look into this as soon as I have some time (maybe tonight or tomorrow)

Thanks for reporting this!

@eliosh
Copy link
Author

eliosh commented Jan 8, 2018

Thanks to you for your great work!

@unreal4u
Copy link
Owner

unreal4u commented Jan 8, 2018

Hi!

v2.9.4 and v3.3.4 implement the fix for this bug, thank you for reporting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants