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

Use webhooks #33

Open
axtrace opened this issue Mar 30, 2019 · 0 comments
Open

Use webhooks #33

axtrace opened this issue Mar 30, 2019 · 0 comments
Labels
Refactoring Good for programm, no affect on user

Comments

@axtrace
Copy link
Owner

axtrace commented Mar 30, 2019

Is your feature request related to a problem? Please describe.
Sometimes bot failes. It looks like this:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/telebot/util.py", line 59, in run
    task(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/telebot/__init__.py", line 276, in __retrieve_updates
    updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
  File "/usr/local/lib/python3.5/dist-packages/telebot/__init__.py", line 246, in get_updates
    json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
  File "/usr/local/lib/python3.5/dist-packages/telebot/apihelper.py", line 180, in get_updates
    return _make_request(token, method_url, params=payload)
  File "/usr/local/lib/python3.5/dist-packages/telebot/apihelper.py", line 54, in _make_request
    timeout=(connect_timeout, read_timeout), proxies=proxy)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 524, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 637, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=30)

There are many cases with the same problem in the internet. Telegram servers may be sometimes anavailable so it causes this kind of promblem.

Describe the solution you'd like
It seems that webhookies would help.

Describe alternatives you've considered
hz

Additional context
There is example of using webhookies in telebot project

@axtrace axtrace added the Refactoring Good for programm, no affect on user label Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactoring Good for programm, no affect on user
Projects
None yet
Development

No branches or pull requests

1 participant