mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-05 20:00:04 +08:00
update v0.0.8.0
This commit is contained in:
@@ -510,11 +510,12 @@ def get_char_data_image(
|
||||
return region, _h
|
||||
|
||||
|
||||
async def init_image(char_data_list: List[Dict], char_detailed_dict: dict):
|
||||
async def init_image(char_data_list: List[Dict], char_detailed_dict: dict, home_data_list: List[Dict]):
|
||||
"""
|
||||
下载头像
|
||||
:param char_data_list: 角色列表
|
||||
:param char_detailed_dict: 角色武器
|
||||
:param home_data_list: 家园列表
|
||||
"""
|
||||
for char in char_data_list:
|
||||
file = image_path / "chars" / f'{char["name"]}.png'
|
||||
@@ -528,3 +529,10 @@ async def init_image(char_data_list: List[Dict], char_detailed_dict: dict):
|
||||
await AsyncHttpx.download_file(
|
||||
char_detailed_dict[char]["weapon_image"], file
|
||||
)
|
||||
for home in home_data_list:
|
||||
file = image_path / "homes" / f'{home["name"]}.png'
|
||||
file.parent.mkdir(parents=True, exist_ok=True)
|
||||
if not file.exists():
|
||||
await AsyncHttpx.download_file(
|
||||
home["icon"], file
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user