Switch to async!

This commit is contained in:
Rykov7
2023-10-28 18:47:34 +03:00
parent 65e04a36e0
commit 5d179b0de2
7 changed files with 136 additions and 233 deletions
+4 -4
View File
@@ -16,7 +16,7 @@ def scheduler():
@repeat(every().day.at("07:00"), PYTHONCHATRU, None)
def remind(chat_to_repeat, today):
async def remind(chat_to_repeat, today):
"""Remind holiday."""
if not today:
today = dt.today()
@@ -33,14 +33,14 @@ def remind(chat_to_repeat, today):
if date.year != 1000:
age = today.year - date.year
notification += f"\n\n🥳 <i>{age}-ая годовщина</i>"
bot.send_message(chat_to_repeat, notification)
await bot.send_message(chat_to_repeat, notification)
@repeat(every().day.at("06:00"), PYTHONCHATRU)
def stat_report(chat_to_repeat):
async def stat_report(chat_to_repeat):
rep = report.create_report_text(PYTHONCHATRU)
if rep:
bot.send_message(chat_to_repeat, rep)
await bot.send_message(chat_to_repeat, rep)
report.reset_report_stats(PYTHONCHATRU)