mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
🐛 修复 TETR.IO 默认头像传参错误
This commit is contained in:
@@ -312,7 +312,10 @@ class Processor(ProcessorMeta):
|
||||
user=TETRIOInfo.User(
|
||||
avatar=f'https://tetr.io/user-content/avatars/{user_info.data.user.id}.jpg?rv={user_info.data.user.avatar_revision}'
|
||||
if user_info.data.user.avatar_revision is not None
|
||||
else f'{{"type":"identicon","hash":"{md5(user_info.data.user.id.encode()).hexdigest()}"}}', # noqa: S324
|
||||
else TETRIOInfo.User.Avatar(
|
||||
type='identicon',
|
||||
hash=md5(user_info.data.user.id.encode()).hexdigest(), # noqa: S324
|
||||
),
|
||||
name=user_name,
|
||||
bio=user_info.data.user.bio,
|
||||
),
|
||||
|
||||
@@ -35,7 +35,11 @@ class Bind(BaseModel):
|
||||
|
||||
class TETRIOInfo(BaseModel):
|
||||
class User(BaseModel):
|
||||
avatar: str
|
||||
class Avatar(BaseModel):
|
||||
type: Literal['identicon']
|
||||
hash: str
|
||||
|
||||
avatar: str | Avatar
|
||||
name: str
|
||||
bio: str | None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user