diff --git a/message_sign/main.py b/message_sign/main.py index e8eca94..7362c2e 100644 --- a/message_sign/main.py +++ b/message_sign/main.py @@ -56,9 +56,9 @@ class SignInSystem: with self._get_redis_connection() as redis_client: last_reset_date_str = redis_client.get('group:sign_in:last_reset_date') if last_reset_date_str: - self.last_reset_date = datetime.datetime.strptime(last_reset_date_str, '%Y-%m-%d').date() + self.last_reset_date = datetime.strptime(last_reset_date_str, '%Y-%m-%d').date() else: - self.last_reset_date = datetime.datetime.now(tz=pytz.timezone(self.timezone)).date() + self.last_reset_date = datetime.now(tz=pytz.timezone(self.timezone)).date() self._save_last_reset_date_to_redis() self.LOG.info(f"[签到] 组件初始化完成 {self.command_format}") @@ -112,7 +112,7 @@ class SignInSystem: def reset_today_count_if_needed(self): """检查并重置每日签到计数""" - current_date = datetime.datetime.now(tz=pytz.timezone(self.timezone)).date() + current_date = datetime.now(tz=pytz.timezone(self.timezone)).date() if current_date != self.last_reset_date: self.today_signin_count.clear() with self._get_redis_connection() as redis_client: