D
D
Danil Neskazhu2020-08-16 17:54:21
Python
Danil Neskazhu, 2020-08-16 17:54:21

How to implement the function of sending notifications to the user in TG aiogram?

There is a function that, after launching the bot using polling, should send a notification message to the person every hour.

How to implement this function so that it does not interfere with the use of other bot functions.

I've tried running this function in (but async doesn't work for it and I thought it was a 'rotten' number) using: followed by a call to the function after the wait. But at the same time, the entire bot freezes due to the cycle, and the rest of the bot functionality does not work. How can this problem be solved? It is necessary that all other functionality of the bot works simultaneously with this function. While True :
time.sleep(3600)



Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-08-16
@AlexMine

Use CRON, write a small script and run it at the right time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question