From 5290b0fc72cb60a740ba149089700e9ec50d63a6 Mon Sep 17 00:00:00 2001
From: CMHopeSunshine <277073121@qq.com>
Date: Sat, 1 Oct 2022 09:47:56 +0800
Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?=
=?UTF-8?q?=E5=9B=A0=E4=B8=BA=E6=97=B6=E5=8C=BA=E9=9D=9E`Asia/Shanghai`?=
=?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
LittlePaimon/plugins/Paimon_DailyNote/handler.py | 6 +++---
LittlePaimon/plugins/Paimon_Info/abyss_statistics.py | 2 +-
LittlePaimon/utils/genshin.py | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/LittlePaimon/plugins/Paimon_DailyNote/handler.py b/LittlePaimon/plugins/Paimon_DailyNote/handler.py
index 3133f62..6cddada 100644
--- a/LittlePaimon/plugins/Paimon_DailyNote/handler.py
+++ b/LittlePaimon/plugins/Paimon_DailyNote/handler.py
@@ -82,13 +82,13 @@ async def check_note():
return
if not subs:
return
- logger.info('原神实时便签', f'开始执行定时检查,共{len(subs)}个任务,预计花费{round(3 * len(subs) / 60, 2)}分钟')
+ logger.info('原神实时便签', f'开始执行定时检查,共{len(subs)}个任务,预计花费{round(6 * len(subs) / 60, 2)}分钟')
for sub in subs:
limit_num = 5 if sub.resin_num and sub.coin_num else 3
if sub.today_remind_num <= limit_num and (
sub.last_remind_time is None or (sub.last_remind_time is not None and (
- sub.last_remind_time < (datetime.datetime.now() - datetime.timedelta(minutes=30)).replace(
- tzinfo=pytz.timezone('Asia/Shanghai'))))):
+ sub.last_remind_time + datetime.timedelta(minutes=30) <= datetime.datetime.now().replace(
+ tzinfo=pytz.timezone('UTC'))))):
data = await get_mihoyo_private_data(sub.uid, str(sub.user_id), 'daily_note')
if isinstance(data, str):
logger.info('原神实时便签', '➤', {'用户': sub.user_id, 'UID': sub.uid}, 'Cookie未绑定或已失效,删除任务', False)
diff --git a/LittlePaimon/plugins/Paimon_Info/abyss_statistics.py b/LittlePaimon/plugins/Paimon_Info/abyss_statistics.py
index e8c6b07..d7cf67d 100644
--- a/LittlePaimon/plugins/Paimon_Info/abyss_statistics.py
+++ b/LittlePaimon/plugins/Paimon_Info/abyss_statistics.py
@@ -34,7 +34,7 @@ async def get_statistics(group_id: int):
member_id_list = [str(member['user_id']) for member in member_list]
info_list = [info for info in info_list if
info.user_id in member_id_list and info.total_battle and info.total_star and info.max_damage and info.max_take_damage]
- now = datetime.datetime.now().replace(tzinfo=pytz.timezone('Asia/Shanghai'))
+ now = datetime.datetime.now().replace(tzinfo=pytz.timezone('UTC'))
info_list = [info for info in info_list if info.start_time <= now <= info.end_time]
if not info_list:
return '本群还没有深渊战斗数据哦!'
diff --git a/LittlePaimon/utils/genshin.py b/LittlePaimon/utils/genshin.py
index 75e03af..4fb745a 100644
--- a/LittlePaimon/utils/genshin.py
+++ b/LittlePaimon/utils/genshin.py
@@ -170,7 +170,7 @@ class GenshinInfoManager:
"""如果角色不存在或者角色的更新时间在6小时前,则更新角色信息"""
character = await Character.get_or_none(**query, data_source='enka')
if not character or character.update_time < (datetime.datetime.now() - datetime.timedelta(hours=pm.config.ysd_auto_update)).replace(
- tzinfo=pytz.timezone('Asia/Shanghai')):
+ tzinfo=pytz.timezone('UTC')):
await self.update_from_enka()
if character := await Character.get_or_none(**query, data_source='enka'):
logger.info('原神角色面板', '➤➤', {'角色': name or character_id}, '数据更新成功', True)
@@ -194,7 +194,7 @@ class GenshinInfoManager:
player_info = await PlayerInfo.get_or_none(user_id=self.user_id, uid=self.uid)
if player_info is None or player_info.update_time is None or player_info.update_time < (
datetime.datetime.now() - datetime.timedelta(hours=pm.config.ysa_auto_update)).replace(
- tzinfo=pytz.timezone('Asia/Shanghai')):
+ tzinfo=pytz.timezone('UTC')):
result = await self.update_from_mihoyo()
if result != '更新成功':
return result, []
@@ -211,7 +211,7 @@ class GenshinInfoManager:
player_info = await PlayerInfo.get_or_none(user_id=self.user_id, uid=self.uid)
if player_info is None or player_info.update_time is None or player_info.update_time < (
datetime.datetime.now() - datetime.timedelta(hours=pm.config.ys_auto_update)).replace(
- tzinfo=pytz.timezone('Asia/Shanghai')):
+ tzinfo=pytz.timezone('UTC')):
result = await self.update_from_mihoyo()
if result != '更新成功':
return result, None