I have a Telegram bot based on free pythonanywhere servers. So, what’s the problem? For some reason the execution is stopped from time to time and no errors are displayed in the console.Example.
I need my bot to be active all the time. What do I do?
2
Answers
On a very general level you can restart your app like this in the same file or from another file
Even if main terminates without an error it will restart.
You might need to do some clean up beforehand.
More specific to your problem:
There always could be an option that an error is silently suppressed and your code ends or something with the server, which will not show up on the console.
1)Create a batch file and run your Main.py file
2)Schedule it with the windows task scheduler with created batch file