How to run a script chat bot VC on Pythone on time?
Writing a chat bot in Python for VC. The point is that it needs to sent once a day certain messages to users. Script for sending a message will lie at the hosting course. The problem with running the script at the time. Script run time on a PC is clear how to do but how to do it on the hosting, for example, every day at 18:00 starts the script and messages are sent to users?
rahsaan.Wiegand answered on March 25th 20 at 13:46
In a separate thread you can do an infinite loop in which it is possible to make the sending of a message, and then put to sleep for 86400 seconds. So, every day, since the start of the program should run.
jasen.Hamill answered on March 25th 20 at 13:48
If Linux, you can add the script to crontab. https://wiki.archlinux.org/index.php/Cron
In short syntax: minute hour danmasani month weekday command
Then the script will not hang in the background all day, and run once every 24 hours.