pyTelegramBotAPI and scaling to zero

I have a telegram bot written using pyTelegramBotAPI. I use the Free tier. I noticed that after the service goes to sleep (after 60 minutes of inactivity), it cannot be woken up by sending a new message.

I found a similar topic, from which I realized that the way my application uses to communicate with the Telegram API (polling) does not assume that sending a new message will wake up the bot. So this behavior is expected, right?

In this case, do I understand correctly that if I do not have the opportunity to switch to a different tier, I should either rewrite the bot so that a webhook is used instead of polling (or will this not help?) or somehow wake it up once an hour using the URL (<YOUR_APP_NAME>-<YOUR_KOYEB_ORGANIZATION>-.koyeb.app)?

Thank you in advance!

Hello @dsaperov,
Yes, using webhook should work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.