mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
🐛 修复时区错误
This commit is contained in:
parent
a1900b1883
commit
0274bb7c6e
@ -40,7 +40,7 @@ async def get_statistics(group_id: int):
|
|||||||
member_id_list = [str(member['user_id']) for member in member_list]
|
member_id_list = [str(member['user_id']) for member in member_list]
|
||||||
info_list = [info for info in info_list if
|
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]
|
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('UTC'))
|
now = datetime.datetime.now().replace(tzinfo=pytz.timezone('Asia/Shanghai'))
|
||||||
info_list = [info for info in info_list if info.start_time <= now <= info.end_time]
|
info_list = [info for info in info_list if info.start_time <= now <= info.end_time]
|
||||||
if not info_list:
|
if not info_list:
|
||||||
return '本群还没有深渊战斗数据哦!'
|
return '本群还没有深渊战斗数据哦!'
|
||||||
|
@ -90,7 +90,7 @@ async def check_note():
|
|||||||
if sub.today_remind_num <= limit_num and (
|
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 is None or (sub.last_remind_time is not None and (
|
||||||
sub.last_remind_time + datetime.timedelta(minutes=30) <= datetime.datetime.now().replace(
|
sub.last_remind_time + datetime.timedelta(minutes=30) <= datetime.datetime.now().replace(
|
||||||
tzinfo=pytz.timezone('UTC'))))):
|
tzinfo=pytz.timezone('Asia/Shanghai'))))):
|
||||||
data = await get_mihoyo_private_data(sub.uid, str(sub.user_id), 'daily_note')
|
data = await get_mihoyo_private_data(sub.uid, str(sub.user_id), 'daily_note')
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
logger.info('原神实时便签', '➤', {'用户': sub.user_id, 'UID': sub.uid}, 'Cookie未绑定或已失效,删除任务', False)
|
logger.info('原神实时便签', '➤', {'用户': sub.user_id, 'UID': sub.uid}, 'Cookie未绑定或已失效,删除任务', False)
|
||||||
|
@ -172,7 +172,7 @@ class GenshinInfoManager:
|
|||||||
character = await Character.get_or_none(**query, data_source='enka')
|
character = await Character.get_or_none(**query, data_source='enka')
|
||||||
if not character or character.update_time < (
|
if not character or character.update_time < (
|
||||||
datetime.datetime.now() - datetime.timedelta(hours=config.ysd_auto_update)).replace(
|
datetime.datetime.now() - datetime.timedelta(hours=config.ysd_auto_update)).replace(
|
||||||
tzinfo=pytz.timezone('UTC')):
|
tzinfo=pytz.timezone('Asia/Shanghai')):
|
||||||
try:
|
try:
|
||||||
await self.update_from_enka()
|
await self.update_from_enka()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -204,7 +204,7 @@ class GenshinInfoManager:
|
|||||||
player_info = await PlayerInfo.get_or_none(user_id=self.user_id, uid=self.uid)
|
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 < (
|
if player_info is None or player_info.update_time is None or player_info.update_time < (
|
||||||
datetime.datetime.now() - datetime.timedelta(hours=config.ysa_auto_update)).replace(
|
datetime.datetime.now() - datetime.timedelta(hours=config.ysa_auto_update)).replace(
|
||||||
tzinfo=pytz.timezone('UTC')):
|
tzinfo=pytz.timezone('Asia/Shanghai')):
|
||||||
result = await self.update_from_mihoyo()
|
result = await self.update_from_mihoyo()
|
||||||
if result != '更新成功':
|
if result != '更新成功':
|
||||||
return result, []
|
return result, []
|
||||||
@ -221,7 +221,7 @@ class GenshinInfoManager:
|
|||||||
player_info = await PlayerInfo.get_or_none(user_id=self.user_id, uid=self.uid)
|
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 < (
|
if player_info is None or player_info.update_time is None or player_info.update_time < (
|
||||||
datetime.datetime.now() - datetime.timedelta(hours=config.ys_auto_update)).replace(
|
datetime.datetime.now() - datetime.timedelta(hours=config.ys_auto_update)).replace(
|
||||||
tzinfo=pytz.timezone('UTC')):
|
tzinfo=pytz.timezone('Asia/Shanghai')):
|
||||||
result = await self.update_from_mihoyo()
|
result = await self.update_from_mihoyo()
|
||||||
if result != '更新成功':
|
if result != '更新成功':
|
||||||
return result, None
|
return result, None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user