Answer the question
In order to leave comments, you need to log in
How to set messages as read after getUpdates?
I receive messages by url, how can I set them as read after receiving them, so that they do not come again?
Google did not give an answer
Api telegram is not entirely clear
Answer the question
In order to leave comments, you need to log in
Add getUpdates ?offset=[update_id]
update_id - from the response, can be stored in a file or database, updating when it changes the
message will only come to those who have update_id > given
You don't need to store anything. I did so
/**
* @return void
*/
public function processUpdates()
{
$updates = $this->api->getUpdates();
$lastUpdateId = null;
foreach ($updates as $update) {
$lastUpdateId = $update->getUpdateId();
$this->processUpdate($update);
}
if ($lastUpdateId) {
$this->api->getUpdates($lastUpdateId + 1, 1);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question