django-telegrambot icon indicating copy to clipboard operation
django-telegrambot copied to clipboard

apps Error : RetryAfter()

Open newton21890 opened this issue 6 years ago • 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.

newton21890 avatar May 29 '18 16:05 newton21890

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

jafrancov avatar Nov 09 '18 22:11 jafrancov

@newton21890 Best approach to solve it PR #10

jafrancov avatar Nov 10 '18 03:11 jafrancov