You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I get the error too many requests to Telegram API. I've looked at other similar issues but in my case I'm sending and receiving v few messages as its still in dev, certainly not more than 1/second. So I guess that's because when my webserver restarts during debugging or because GCP (App Engine) is switching workers it re-runs the set_webhook? Or could one pending message hit my server too many times? Or something else?
As I'm running this on a web server long polling is not an easy option. But likewise the guidance I've been given on how to maintain a connection without re-running 'set_webhook' is also quite loose "sometimes it'll clear the webhook when there's a bug etc etc" so I'm not sure how to put logic around it or cache it.
Has anyone else had to deal with this and what's the best way?
Is there a simple way to put an if(current_webhook) condition around this as one does to prevent too many disconnect and reconnections to DB? Thanks
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is anyone else just setting a webhook on their web server like so (you'll notice I'm not calling remove_webhook():
bot = telebot.TeleBot(TOKEN)
bot.set_webhook(url=WEBHOOK_URL + WEBHOOK_PATH)
Sometimes I get the error too many requests to Telegram API. I've looked at other similar issues but in my case I'm sending and receiving v few messages as its still in dev, certainly not more than 1/second. So I guess that's because when my webserver restarts during debugging or because GCP (App Engine) is switching workers it re-runs the set_webhook? Or could one pending message hit my server too many times? Or something else?
As I'm running this on a web server long polling is not an easy option. But likewise the guidance I've been given on how to maintain a connection without re-running 'set_webhook' is also quite loose "sometimes it'll clear the webhook when there's a bug etc etc" so I'm not sure how to put logic around it or cache it.
Has anyone else had to deal with this and what's the best way?
Is there a simple way to put an if(current_webhook) condition around this as one does to prevent too many disconnect and reconnections to DB? Thanks
Django on Python 3.10
Beta Was this translation helpful? Give feedback.
All reactions