Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket receive some updates multiple times #90

Open
AmirHosseinKarimi opened this issue Jun 7, 2022 · 2 comments
Open

Websocket receive some updates multiple times #90

AmirHosseinKarimi opened this issue Jun 7, 2022 · 2 comments

Comments

@AmirHosseinKarimi
Copy link

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

@xtrime-ru
Copy link
Owner

Can you give more context about this issue?

@xtrime-ru
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@AmirHosseinKarimi @xtrime-ru and others