Skip to content

Commit

Permalink
Merge pull request #73 from Cypas/dev_cypas
Browse files Browse the repository at this point in the history
fix:badges图片缓存路径不统一
  • Loading branch information
Cypas authored Jun 24, 2024
2 parents 87e3adf + d4287f7 commit 1827853
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nonebot_plugin_splatoon3_nso/handle/b_or_c_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async def get_badge_username(name, icon, area, ranking, max_badge, badge_badge_p

name = name.strip() + f'</br><span style="color:{color}">{_x}{ranking_str}({badge_badge_point_str})</span>'
# 武器图片
img_type = "badges"
img_type = "user_nameplate_badge"
weapon_main_img = await model_get_temp_image_path(img_type, max_badge)
if weapon_main_img:
# 高优先级显示徽章图片而不是头像
Expand Down
6 changes: 5 additions & 1 deletion nonebot_plugin_splatoon3_nso/handle/battle.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,11 @@ async def get_row_user_stats(k_idx, p, mask=False, is_last_player=False, team_po
if not b:
continue
badge_name = b.get('id') or ''
badges_list.append(badge_name)
badge_img = (b.get('image') or {}).get('url') or ''
if badge_img != "":
img_type = "user_nameplate_badge"
await model_get_temp_image_path(img_type, b['id'], badge_img)
badges_list.append(badge_name)
area, ranking, max_badge, badge_badge_point = get_badges_point(badges_list)
if badge_badge_point > power:
# 徽章置分
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_splatoon3_nso/handle/my.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async def get_me_md(user: GlobalUserInfo, summary, total, coops, from_group=Fals
_b_id = b.get('id')
_b_url = (b.get('image') or {}).get('url')
if _b_url:
b_img = await model_get_temp_image_path('badges', _b_id, _b_url)
b_img = await model_get_temp_image_path('user_nameplate_badge', _b_id, _b_url)
_style = f'position:absolute;margin-top:-4px;margin-left:{_idx * 30}px'
badges_str += f'''<img height='30px' style='{_style}' src="{b_img}"/>'''
_idx += 1
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_splatoon3_nso/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

BOT_VERSION = "2.7.3"
BOT_VERSION = "2.7.4"
DIR_RESOURCE = f"{os.path.abspath(os.path.join(__file__, os.pardir, os.pardir))}/resource"
plugin_release_time = "2024-06-24 04:35:58" # 预留 2.0.0重构版nso插件发布时间,预计发布时对全部用户先显示一周,之后再判断用户创建时间

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-plugin-splatoon3-nso"
version = "1.5.3"
version = "1.5.4"
description = "一个基于nonebot2框架的splatoon3游戏nso数据查询插件"
authors = ["cypas <ayano05@outlook.com>"]
readme = "README.md"
Expand Down

0 comments on commit 1827853

Please sign in to comment.