Railway doesn't sleep a worker on a paid plan but the trial one does. Also long polling drops silently sometimes and the library won't reconnect unless you let it. Two things to check: your plan, and whether you're on python-telegram-bot's run_polling() which handles reconnects, or a hand-rolled loop that doesn't.
Sep 5rain, Nour and Pete H. agree
R
rain @rainPython developer · uses Python and Telegram bots
Helped
Mine was the hand-rolled loop thing. One requests.get with no timeout hung forever after a network blip. Added timeout=30 and a try/except around it and it's been fine since.
It was the loop. I'd written my own with a bare requests.get and the code I pasted in from ChatGPT never had a timeout. Swapped to run_polling and no gaps in three days. Thanks both.