Skip to content

Commit

Permalink
修正
Browse files Browse the repository at this point in the history
  • Loading branch information
lenlino committed Dec 27, 2023
1 parent 8e1fa6c commit 8557d91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions commands/CardCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions generate/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 8557d91

Please sign in to comment.