diff --git a/commands/CardCommand.py b/commands/CardCommand.py index 4dd3e2f..aee84c1 100644 --- a/commands/CardCommand.py +++ b/commands/CardCommand.py @@ -104,8 +104,9 @@ async def button_callback(interaction): is_hideUID=is_uid_hide , calculating_standard=calculation_value, lang=lang, is_hide_roll=is_roll_hide) - image_binary.write(panel_img_result['img']) - + #image_binary.write(panel_img_result['img']) + panel_img = panel_img_result['img'] + panel_img.save(image_binary, 'PNG') image_binary.seek(0) dt_now = datetime.datetime.now() file = discord.File(image_binary, f"hertacardsys_{dt_now.strftime('%Y%m%d%H%M')}.png") @@ -125,7 +126,8 @@ async def button_callback(interaction): weight_text += f"{i18n.t(f'message.{k}', locale=lang)}: {v}\n" res_embed.add_field(name=i18n.t(f'message.weight', locale=lang), value=weight_text) - score_rank = panel_img_result["header"] + #score_rank = panel_img_result["header"] + score_rank = generate.utils.get_score_rank(int(avatar_id), uid, panel_img_result['score']) # 統計 rank_text = "" rank_text += f"{i18n.t('message.Rank', locale=lang)}: {score_rank['rank']} / {score_rank['data_count']}\n" diff --git a/generate/generate.py b/generate/generate.py index 33c4f3f..ef2fe33 100644 --- a/generate/generate.py +++ b/generate/generate.py @@ -15,7 +15,7 @@ async def generate_panel(uid="805477392", chara_id=1, template=1, is_hideUID=False, calculating_standard="compatibility", lang="jp", is_hide_roll=False): result_json = {} - async with aiohttp.ClientSession(connector_owner=False, connector=conn) as session: + '''async with aiohttp.ClientSession(connector_owner=False, connector=conn) as session: async with session.get(f"https://hcs.lenlino.com/gen_card/{uid}?lang={lang}&select_number={chara_id}&calculation_value={calculating_standard}" f"&is_uid_hide={is_hideUID}&is_hide_roll={is_hide_roll}") as response: @@ -28,7 +28,7 @@ async def generate_panel(uid="805477392", chara_id=1, template=1, is_hideUID=Fal "data_count": response.headers.get("x-data-count")} return result_json else: - result_json["detail"] = response.status + result_json["detail"] = response.status''' if template == 1: return await one.generate_panel(uid=uid, chara_id=chara_id, is_hideUID=is_hideUID, calculating_standard=calculating_standard)