mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🐛 Fix KeyError in abyss_team
This commit is contained in:
parent
055740edc1
commit
ab99b3fe92
@ -761,9 +761,9 @@ def roleToId(name: str) -> int | None:
|
|||||||
|
|
||||||
# noinspection PyPep8Naming
|
# noinspection PyPep8Naming
|
||||||
@functools.lru_cache()
|
@functools.lru_cache()
|
||||||
def idToName(id: int) -> str | None:
|
def idToName(cid: int) -> str | None:
|
||||||
"""从角色ID获取正式名"""
|
"""从角色ID获取正式名"""
|
||||||
return roles[id][0] if id in roles else None
|
return roles[cid][0] if cid in roles else None
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyPep8Naming
|
# noinspection PyPep8Naming
|
||||||
|
@ -100,7 +100,7 @@ class AbyssTeamPlugin(Plugin):
|
|||||||
{
|
{
|
||||||
"icon": (await self.assets_service.avatar(cid).icon()).as_uri(),
|
"icon": (await self.assets_service.avatar(cid).icon()).as_uri(),
|
||||||
"name": idToName(cid),
|
"name": idToName(cid),
|
||||||
"star": AVATAR_DATA[str(cid)]["rank"],
|
"star": AVATAR_DATA[str(cid)]["rank"] if cid not in {10000005, 10000007} else 5,
|
||||||
"hava": True,
|
"hava": True,
|
||||||
}
|
}
|
||||||
for cid in id_list
|
for cid in id_list
|
||||||
|
Loading…
Reference in New Issue
Block a user