I am writing a telegram bot, and it needs to send a message to the user at 9.00 Am. But since the bot constantly communicates with users inside the function, a time check outside the function is not performed. I’m a beginner and I don’t quite understand how to arrange the check so that the bot sends messages to users regardless of what it is doing right now
I put the check in an infinite loop, but quickly realized that it didn’t make sense, since the infinite loop just blocked the bot from accessing the rest of the code. Now I’m at a dead end
P.S I work with the “TeleBot” library, and the main functionality of the bot is to register clients for classes via the API
Aleksey Kostitsun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.