From 2def74029553055224df93e812f54d17d682cc19 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:26:25 +0800 Subject: [PATCH] Update statistics_hook.py --- plugins/statistics_hook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/statistics_hook.py b/plugins/statistics_hook.py index b6cb58e9..af5659db 100644 --- a/plugins/statistics_hook.py +++ b/plugins/statistics_hook.py @@ -117,6 +117,10 @@ async def _(): for key in _prefix_count_dict['day_statistics'][group_id].keys(): _prefix_count_dict['day_statistics'][group_id][key] = 0 _prefix_count_dict['day_index'] += 1 + if _prefix_count_dict['day_index'] % 7 == 0: + _prefix_count_dict['week_statistics']['total'] = {} + if _prefix_count_dict['day_index'] % 30 == 0: + _prefix_count_dict['month_statistics']['total'] = {} with open(DATA_PATH + '_prefix_count.json', 'w', encoding='utf8') as f: json.dump(_prefix_count_dict, f, indent=4, ensure_ascii=False)