Исправлена задача сброса счетчиков (запускалась только один раз).
This commit is contained in:
parent
6388760ebb
commit
a41d7ece98
1 changed files with 12 additions and 10 deletions
2
bot.py
2
bot.py
|
|
@ -176,6 +176,7 @@ async def counters_reset_task():
|
|||
target_date = now.date()
|
||||
target_datetime = datetime.datetime.combine(target_date, target_time)
|
||||
|
||||
while True:
|
||||
await wait_until(target_datetime)
|
||||
|
||||
print('Resetting daily counters...')
|
||||
|
|
@ -190,6 +191,7 @@ async def counters_reset_task():
|
|||
config.DB['chats'][chat_id]['users'][user_id]['messages_month'] = 0
|
||||
|
||||
db_save()
|
||||
target_datetime = target_datetime + datetime.timedelta(days=1)
|
||||
|
||||
|
||||
async def startup_task():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue