JungDev/django-telegrambot

apps Error : RetryAfter()

newton21890 opened this issue · 2 comments

I'm trying to use django-telegram bot but during the running phase I have this error frequently:

ERROR 2018-05-29 16:28:47,375 apps Error : RetryAfter()
after this message the system doesn't work, this is the message during the chat:

WARNING 2018-05-29 16:28:55,619 views Request for not found token : XXXXXXXXXXXXXX
[29/May/2018 16:28:55]"POST /prefix/XXXXXXXXXXXXXXXX/ HTTP/1.1" 200 2

The result is that I don't receive any message in telegram.

I think the problem is in the rapidly sequence of instruction in apps.py file during the setWebhook phase .
A possible solution that I finded is this:

setted = bot.setWebhook(hookurl, certificate=certificate, timeout=timeout, max_connections=max_connections, allowed_updates=allowed_updates)
time.sleep(5)
webhook_info = bot.getWebhookInfo()

I added to time.sleep function and now the system seems to work.

Have you find any other solution? When I add that line, sends me a 404 page.

@newton21890 Best approach to solve it PR #10