mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-23 00:01:45 +00:00
🐛 当解析旅行者数据错误时、跳过旅行者
Signed-off-by: Karako <karakohear@gmail.com>
This commit is contained in:
parent
3b1a46837d
commit
cf7012bed0
@ -66,7 +66,14 @@ class AvatarListPlugin(Plugin, BasePlugin):
|
|||||||
for num, character in enumerate(characters):
|
for num, character in enumerate(characters):
|
||||||
if num == max_length: # 若已经有 max_length 个角色
|
if num == max_length: # 若已经有 max_length 个角色
|
||||||
break
|
break
|
||||||
|
try:
|
||||||
detail = await client.get_character_details(character)
|
detail = await client.get_character_details(character)
|
||||||
|
except Exception as e: # pylint: disable=W0703
|
||||||
|
if character.name == "旅行者":
|
||||||
|
logger.debug(f"解析旅行者数据时遇到了错误:{e}")
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
if character.id == 10000005: # 针对男草主
|
if character.id == 10000005: # 针对男草主
|
||||||
talents = []
|
talents = []
|
||||||
for talent in detail.talents:
|
for talent in detail.talents:
|
||||||
@ -202,5 +209,5 @@ class AvatarData(Model):
|
|||||||
avatar: Character
|
avatar: Character
|
||||||
detail: CalculatorCharacterDetails
|
detail: CalculatorCharacterDetails
|
||||||
icon: str
|
icon: str
|
||||||
weapon: str
|
weapon: Optional[str]
|
||||||
skills: Iterable[SkillData]
|
skills: Iterable[SkillData]
|
||||||
|
Loading…
Reference in New Issue
Block a user