diff --git a/LittlePaimon/plugins/Paimon_Gacha_Log/draw.py b/LittlePaimon/plugins/Paimon_Gacha_Log/draw.py index 19a8fe4..ab8fe39 100644 --- a/LittlePaimon/plugins/Paimon_Gacha_Log/draw.py +++ b/LittlePaimon/plugins/Paimon_Gacha_Log/draw.py @@ -151,7 +151,7 @@ async def draw_four_star(info: FourStarItem) -> PMImage: async def draw_four_star_detail(data: List[FourStarItem]): - data.sort(key=lambda x: sum(x.num['角色祈愿'] + x.num['武器祈愿'] + x.num['常驻祈愿'] + x.num['新手祈愿']), reverse=True) + data.sort(key=lambda x: x.num['角色祈愿'] + x.num['武器祈愿'] + x.num['常驻祈愿'] + x.num['新手祈愿'], reverse=True) bar = await load_image(RESOURCE_BASE_PATH / 'gacha_log' / 'four_star_bar.png') total_height = 105 + 260 * math.ceil(len(data) / 5) bg = PMImage(size=(1008, total_height), mode='RGBA', color=(255, 255, 255, 0)) diff --git a/LittlePaimon/utils/api.py b/LittlePaimon/utils/api.py index 0dd09bf..38fd02b 100644 --- a/LittlePaimon/utils/api.py +++ b/LittlePaimon/utils/api.py @@ -420,7 +420,7 @@ async def get_authkey_by_stoken(user_id: str, uid: str) -> Tuple[Optional[str], 'game_uid': uid, 'region': server_id}) data = data.json() - if 'data' in data and 'authkey' in data['data']: + if data.get('data') is not None and 'authkey' in data['data']: return data['data']['authkey'], True, cookie_info else: return None, False, cookie_info