These are chat archives for irazasyed/telegram-bot-sdk

10th
Dec 2015
Ihor Polyakov
@ihoru
Dec 10 2015 02:16

Hello, everyone!
I think this part of documentation should be modified not to mislead users:

Make Specific API Requests Async

// When building the API request, just make a call to the setAsyncRequest method passing true
// now making a request won't block the execution of the script.
// Similarly if you want to do the other way around, just pass false (Make a specific API call a synchronous request).

// Standalone
$telegram
   ->setAsyncRequest(true)
   ->sendPhoto('CHAT_ID', 'path/to/photo.jpg');

// Laravel
Telegram::setAsyncRequest(true)
          ->sendPhoto('CHAT_ID', 'path/to/photo.jpg');

In fact you should call

...in fact you should call:
Telegram::setAsyncRequest(true)->sendPhoto('CHAT_ID', 'path/to/photo.jpg')->setAsyncRequest(false);

to make a specific API call has negative synchronous logic as default

Ihor Polyakov
@ihoru
Dec 10 2015 02:37
@irazasyed , do you have plans about new release with all unreleased changes? (BTW, we will need to update all docs, where are examples of calling API methods...)