unreal4u / telegram-api

Complete async capable Telegram bot API implementation for PHP7
https://github.com/unreal4u/telegram-api/wiki
MIT License
784 stars 172 forks source link

Sending requests #126

Closed askador closed 3 years ago

askador commented 3 years ago

Hello!

I have a question about sending requests

$TgLog->performApiRequest($SendSticker);
$TgLog->performApiRequest($SendMessage);

sending sticker and message should be in that order, but message come first could you help please?

unreal4u commented 3 years ago

Hi!

If you want the requests to Telegram's API to be in a specific order, you'll have to perform 'blocking' requests (otherwise React does what it does and performs async requests), an example of such a request can be found here: https://github.com/unreal4u/telegram-api/blob/master/examples/01.blocking-get-me.php

Greetings.

PD: Otherwise, you can perform your second request within the promise of the first :+1:

unreal4u commented 3 years ago

Closing due to inactivity