Closed just-pthai-it closed 7 months ago
[Update] I tried to debug src code and found that the body of POST request is empty. The property data of Telegraph class is empty when called in InteractsWithTelegram trait. No timeout and offset parameters were passed. That 's why long polling did not work.
[Update 2] The reason why the data of Telegraph is empty is that you set the data property of Telegraph instance but you return the clone version of it in the function below.
HasBotsAndChats.php
public function botUpdates(int $timeout = null, int $offset = null, int $limit = null, array $allowedUpdates = null): Telegraph
{
$telegraph = clone $this;
$telegraph->endpoint = self::ENDPOINT_GET_BOT_UPDATES;
if($offset !== null) {
$this->data['offset'] = $offset;
}
if($limit !== null) {
$this->data['limit'] = $limit;
}
if($timeout !== null) {
$this->data['timeout'] = $timeout;
}
if($allowedUpdates !== null) {
$this->data['allowed_updates'] = $allowedUpdates;
}
return $telegraph;
}
fixed, we are releasing a patch right now
thanks!
Just like the title, I am unable to use long poling. It always return response immediately. Here is my script: `
` I tried long polling by calling telegram getUpdates API using Postman with timeout and offset parameters and it did work.