After closing the console, Telegram notifications are set off
Kondrill opened this issue · 3 comments
Hi, i am relatively new to coding and this might be a very stupid question.
I installed the code via the Windows console and connected it with Telegram, which works. But as soon as I close my console, the bot stops working. Is this normal, so that the bot can only be used when the console is on? Or is there a way of getting to "program" it into a kind of "offline" bot?
Hi, I have a similar setup, OS Windows on a little tablet and Windows console for execution.
It is normal that when you close the console the application is stopped as well, so it needs to run permanently in order for the app to do so.
Maybe there's a way in Windows to set applications to the background so it is not in the front anymore. Otherwise you can try to install the application on a cloud service like Dropbox/Google/AWS, so the execution is not done locally anymore.
Under Linux I am using Screen utility to make sure, that the app continues running after closing it.
There might be alternatives for it in Windows, I am not sure though. You may want to look into AWS, Google Cloud or Heroku to run it even when your PC is turned off :) Raspberry Pi is also a great option as it has minimal power consumption and is very easy to configure locally.
Both under Windows and Linux, Docker would be the 'best' way to run the tool in the background.
With Docker you get all these features:
- No specific dependencies / tools needed (if you only use Docker for this tool that doesn't really apply, though)
- Run in background
- Run on startup
- Easy updates / version management