🐛 avatar_revision 为 0 时 使用 identicon

This commit is contained in:
2024-06-16 09:01:17 +08:00
parent 3e75a4b4e2
commit 2f900d0538
2 changed files with 3 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ async def _(nb_user: User, account: Player, event_session: EventSession, bot_inf
user=People(
avatar=f'http://{netloc}/host/resource/tetrio/avatars/{user.ID}?{urlencode({"revision": user_info.data.user.avatar_revision})}'
if user_info.data.user.avatar_revision is not None
and user_info.data.user.avatar_revision != 0
else Avatar(type='identicon', hash=md5(user_info.data.user.id.encode()).hexdigest()), # noqa: S324
name=user_info.data.user.username.upper(),
),