When something breaks
Telegram bot stopped responding: why it happens and how to fix it
In short
A Telegram bot usually stops responding for one of three reasons: the process running it went down together with your computer, it crashed with an error and nothing restarted it, or two copies are running at once and stealing updates from each other. Start with the logs, because the last line before the silence almost always names the cause. To keep the bot running independently of your laptop and coming back after a failure, run it on a server or on a platform such as Netrun, which restarts the project when it fails and sends you a notification.
Yesterday the bot answered, today it is silent. Messages go through, nothing comes back, and the first instinct is to open the code. Usually the code is not the problem. When a Telegram bot has stopped responding, the reason is almost always where and how it runs: the process that kept it alive stopped existing, and nothing brought it back. The code is exactly what it was yesterday.
Below the causes are ordered by how often they happen, and the steps work as a diagnosis from the most common one down. One case stands apart: a bot that answers every other message. That is almost always two copies running at the same time, and there is a separate guide about it. Normally the author is the one watching the bot, noticing the silence and restarting it by hand. On Netrun the platform does that part: the project restarts after a failure, you get a notification, and the logs are always open on the project page.
Check whether the bot runs on your own computer#
Most often the bot stopped responding simply because it runs on the same machine you wrote it on. Close the laptop lid, let the computer sleep, lose the internet connection or close the window you started it from, and the bot goes down with it. The pattern is easy to recognize: the bot comes back when you sit down at your computer and goes quiet when you leave. If that is your case there is nothing to fix in the code, the bot simply has to run somewhere that does not depend on you.
Open the logs and find the last line before the silence#
Logs are the diary of your bot: what it did and where it stopped. Look at the time of the last entry, because it almost always matches the moment the bot went quiet and explains why. Typical answers are a dropped connection to Telegram, running out of memory, or the app tripping over one particular message such as a photo where text was expected. On Netrun the logs are on the project page in real time, and on your own server you read the process output or the file it writes to.
Make sure exactly one copy is running#
If the bot is started twice, for example on a server and also on your laptop, the copies start taking updates away from each other. From the outside it looks like the bot answers every other message: part of the traffic goes to the other copy, and the logs complain about another getUpdates request. Stop every instance except one, and check that the old process really exited instead of sitting in the background.
Check the token and how Telegram responds#
The BotFather token, which is the password Telegram issues for your bot, may have been reissued, and with the old one the bot will not connect and says so in the logs at startup. Make sure the project holds the current token and that it arrives as a secret rather than sitting in code you forgot to update. Telegram also throttles bots that send messages too quickly, so a broadcast with no pauses gets partly rejected, and adding a short delay between sends fixes it.
See whether the trial or the money ran out#
If the bot lives on a hosting platform or a rented server, open the project status and the billing page: free plans usually limit how long a bot may run, and a pay as you go server can simply run out of funds. On Netrun a bot on the free plan runs for three days and then switches off, while the code, settings and secrets stay in place, and a warning arrives a day before. Such a project shows up as stopped in your account: only the Pro plan brings it back, and changing the code will not help here.
Move the bot somewhere that restarts it for you#
Once you know the cause, the point is to stop it from happening again: the bot needs a machine that does not sleep and something that brings it back after a crash. Upload the code folder as an archive or connect a GitHub repository, add the BotFather token, and Netrun detects the language, builds the project and starts the bot. After that the platform watches it: the project restarts after a failure, you get a notification, and the logs stay open in your account so the next cause is visible right away.
The order of checks is always the same. First find out whether the bot lives independently of your computer, then read the logs, then confirm that only one copy is running. If the bot goes quiet at night and comes back with your laptop, rewriting the code changes nothing and the bot just needs to run somewhere else. If the logs keep repeating the same error, moving it will not help either, because that one is in the code. Try Netrun.
Common questions
Why does my bot stop responding at night and work again in the morning?
That is how a bot behaves when it runs on your own computer: at night the machine sleeps or loses its connection, and in the morning you wake it up and the bot returns. There is no bug in the code. The only real fix is to run the bot on a server or a platform that keeps working without you.
The bot works for a few hours and then goes silent. What is happening?
Usually an unhandled error: the bot receives a message it was not written for, crashes, and nothing starts it again. Less often the app slowly eats memory until it gets killed. The logs give the exact answer, so read the last lines before the entries stopped.
What does the error about another getUpdates request mean?
Telegram is telling you that two clients came for updates with the same token, which means two copies of your bot are running. Keep one and stop the rest, including the one on your own computer. There is a separate guide in the blog with the symptoms and the steps.
My bot does not reply to everyone. Is that a Telegram limit?
It can be: Telegram throttles bots that send messages too fast, so a broadcast with no pauses is partly rejected. More often though, replying to only some users means two copies are splitting the updates between them. Check the number of running copies first, then the sending rate.
How do I tell whether the code is at fault or the place where the bot runs?
If the logs contain an error message and it repeats on the same action, the code is at fault. If the entries simply stop with no error, and that matches a computer shutting down, a server reboot or paid time running out, the environment is at fault. A bug shows up as a line, a dead environment shows up as silence.
Will switching to webhooks stop my bot from going down?
Not on its own: webhooks change how messages reach the bot, not how resilient the process is. A bot that crashes on an error or dies with your laptop stays silent either way. Solve where it runs and what restarts it first, then pick the delivery method that suits you.
Where can I see the logs and status of my project?
The project page shows the status, the logs and the event history — together they show what is happening with the project right now. The log view also reaches further back: scroll up and earlier lines load on their own.
What happens if my app crashes?
We watch over projects and restart them if they fail. If something goes wrong, you can see the status and logs in your account and you get a notification.
Do bots and background scripts sleep?
No, only websites sleep: a website wakes up by itself when someone opens it. A bot or a background script has nothing to wake it — nobody comes to them by link, they work on their own. That is why on the free plan they run for 3 days, and after that a bot needs the Pro plan to keep running around the clock.
What happens to my bot after 3 days on the free plan?
The bot switches off, but your code, settings and secrets stay where they are — we delete nothing. A day before it switches off we send you a warning. Switch to the Pro plan, and the bot starts again from the same place and runs around the clock. A new bot uploaded after that is built too, but it will not start: free time is counted per account, not per project.