Compare commits

..

2 Commits
1.1.3 ... 1.1.4

Author SHA1 Message Date
ac4631d1f3 🔖 1.1.4 2024-05-10 12:20:48 +08:00
b0ee7fe6c7 🐛 修复 TETR.IO 默认头像传参错误 2024-05-10 12:20:25 +08:00
3 changed files with 10 additions and 3 deletions

View File

@@ -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,
),

View File

@@ -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

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = 'nonebot-plugin-tetris-stats'
version = '1.1.3'
version = '1.1.4'
description = '一款基于 NoneBot2 的用于查询 Tetris 相关游戏数据的插件'
authors = ['scdhh <wallfjjd@gmail.com>']
readme = 'README.md'