I
I
i_surin2016-06-29 21:35:22
Python
i_surin, 2016-06-29 21:35:22

How to tell telegram bot to send messages every hour?

It is necessary to make the bot send messages to everyone who uses it every hour or two, the main thing is that with some interval in time, the exact figure is not important.
I am writing in python 3 with the Telebot library, so far my brain has reached the point of receiving datetime. ) add it with a number equal to 1 hour using timedelta and that ’s it
. Actually, I can’t understand this, for the task at hand, you need to put it all into some kind of eternal loop that will check it all? Or is there something in telegram api or telebot that can help me with my question?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#algooptimize #bottize, 2016-06-29
@i_surin

Once an hour, run the script and send a message, it makes little sense to keep the process with one slip per hour.
Or while(true) sleep(1hour) and send messages Does
the list of users already exist?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question