D
D
Denis Michurin2017-06-26 14:54:17
linux
Denis Michurin, 2017-06-26 14:54:17

Executing a method at a specific time?

Good afternoon, the question is the following. There is a function from a specific bot class. The bot will constantly work to receive and send responses to clients. But it is necessary to implement that a certain function of sending a message to the client is executed at a well-defined time. How to implement so that the body of the function is executed at a well-defined time, for example at 13:00, every day?

def sendMess(self):
        users = user.infoUserDB()
        temp = dic.set_phr()
        for chatid in users:
            for tem in temp:
                bot.send_message(chatid[1],tem[1])

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
longclaps, 2017-06-26
@longclaps

Most system administrators know how to use cron.
Learn and you.

D
Dmitry, 2017-06-26
@LazyTalent

schedule

Q
qlkvg, 2017-06-26
@qlkvg

Execute python script every 24 hours?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question