xtrime-ru / TelegramApiServer

Fast, simple, async php telegram api server: MadelineProto + Amp HTTP Server
https://tg.i-c-a.su
MIT License
562 stars 124 forks source link

Websocket receive some updates multiple times #90

Open AmirHosseinKarimi opened 2 years ago

AmirHosseinKarimi commented 2 years ago

Looks like the new changes for Websocket cause receiving some updates multiple times.

xtrime-ru commented 2 years ago

Can you give more context about this issue?

xtrime-ru commented 10 months ago

There are new ways of receving updates now: https://github.com/xtrime-ru/TelegramApiServer#get-eventsupdates

There are multiple ways of getting updates in TelegramApiServer / MadelineProto:

  1. Websocket
  2. Long Polling: send request to getUpdates endpoint curl "127.0.0.1:9503/api/getUpdates?data[limit]=3&data[offset]=0&data[timeout]=10.0" -g
  3. Webhook: Redirect all updates to your endpoint, just like bot api! curl "127.0.0.1:9503/api/setWebhook?url=http%3A%2F%2Fexample.com%2Fsome_webhook" -g Example uses urlencoded url in query.

Also eventHandler is not reset after service restart, so there should be less events loss.