From ed95c8c9faaec7948e307a573001eb1be36e0001 Mon Sep 17 00:00:00 2001 From: shoucandanghehe Date: Mon, 1 Jul 2024 14:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_tetris_stats/games/tetrio/query.py | 3 ++- .../utils/render/schemas/tetrio/tetrio_user_info_v2.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nonebot_plugin_tetris_stats/games/tetrio/query.py b/nonebot_plugin_tetris_stats/games/tetrio/query.py index 47623b4..c6fb35f 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/query.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/query.py @@ -368,8 +368,9 @@ async def make_query_image_v2(player: Player) -> bytes: for i in user_info.data.user.badges ], country=user_info.data.user.country, + role=user_info.data.user.role, xp=user_info.data.user.xp, - friend_count=user_info.data.user.friend_count or 0, + friend_count=user_info.data.user.friend_count, supporter_tier=user_info.data.user.supporter_tier, bad_standing=user_info.data.user.badstanding or False, verified=user_info.data.user.verified, diff --git a/nonebot_plugin_tetris_stats/utils/render/schemas/tetrio/tetrio_user_info_v2.py b/nonebot_plugin_tetris_stats/utils/render/schemas/tetrio/tetrio_user_info_v2.py index dd954c5..54193b8 100644 --- a/nonebot_plugin_tetris_stats/utils/render/schemas/tetrio/tetrio_user_info_v2.py +++ b/nonebot_plugin_tetris_stats/utils/render/schemas/tetrio/tetrio_user_info_v2.py @@ -1,4 +1,5 @@ from datetime import datetime +from typing import Literal from pydantic import BaseModel @@ -21,12 +22,14 @@ class User(BaseModel): name: str country: str | None + role: Literal['anon', 'user', 'bot', 'halfmod', 'mod', 'admin', 'sysop', 'banned'] + avatar: str | Avatar banner: str | None bio: str | None - friend_count: int + friend_count: int | None supporter_tier: int verified: bool