🐛 修复 _lang 为私有变量不会默认序列化的bug

This commit is contained in:
2025-04-27 15:17:12 +08:00
parent 7c0b3cd240
commit 56e06a7001
16 changed files with 17 additions and 17 deletions

View File

@@ -81,7 +81,7 @@ async def _(nb_user: User, account: Player, event_session: EventSession, bot_inf
name=bot_info.user_name,
),
prompt='io查我',
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -89,7 +89,7 @@ async def _(
for i in league.data.entries
if isinstance(i, Entry)
],
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -93,7 +93,7 @@ async def make_query_image_v1(player: Player) -> bytes:
sprint=sprint_value,
blitz=blitz_value,
),
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -188,7 +188,7 @@ async def make_query_image_v2(player: Player) -> bytes:
if blitz.data.record is not None
else None,
zen=Zen(level=zen.data.level, score=zen.data.score),
_lang=get_lang(),
lang=get_lang(),
),
),
) as page_hash:

View File

@@ -83,7 +83,7 @@ async def make_image_v1(latest_data: TETRIOLeagueStats, compare_data: TETRIOLeag
for i in zip(latest_data.fields, compare_data.fields, strict=True)
},
updated_at=latest_data.update_time,
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:
@@ -111,7 +111,7 @@ async def make_image_v2(latest_data: TETRIOLeagueStats, compare_data: TETRIOLeag
for i in zip(latest_data.fields, compare_data.fields, strict=True)
},
updated_at=latest_data.update_time,
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -123,7 +123,7 @@ async def make_image(rank: ValidRank, latest: TETRIOLeagueStats, compare: TETRIO
vs_holder=latest_data.high_vs.username.upper(),
),
updated_at=latest.update_time.replace(tzinfo=UTC).astimezone(ZoneInfo('Asia/Shanghai')),
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -146,7 +146,7 @@ async def make_blitz_image(player: Player) -> bytes:
level=stats.level,
),
play_at=blitz.data.record.ts,
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -146,7 +146,7 @@ async def make_sprint_image(player: Player) -> bytes:
),
),
play_at=sprint.data.record.ts,
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -69,7 +69,7 @@ async def _(nb_user: User, event_session: EventSession, bot_info: UserInfo = Bot
name=bot_info.user_name,
),
prompt='io绑定{游戏ID}',
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -55,7 +55,7 @@ async def _(
name=bot_info.user_name,
),
prompt='top查我',
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -96,7 +96,7 @@ async def make_query_image(profile: UserProfile) -> bytes:
apl=history.apl,
apm_trending=Trending.KEEP,
),
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -57,7 +57,7 @@ async def _(
name=bot_info.user_name,
),
prompt='top绑定{游戏ID}',
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -55,7 +55,7 @@ async def _(
name=bot_info.user_remark or bot_info.user_displayname or bot_info.user_name,
),
prompt='茶服查我',
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -304,7 +304,7 @@ async def make_query_image(user_info: UserInfoSuccess, game_data: GameData, even
challenge=f'{int(user_info.data.pb_challenge):,}' if user_info.data.pb_challenge != '0' else 'N/A',
marathon=f'{int(user_info.data.pb_marathon):,}' if user_info.data.pb_marathon != '0' else 'N/A',
),
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -60,7 +60,7 @@ async def _(
name=bot_info.user_name,
),
prompt='茶服绑定{游戏ID}',
_lang=get_lang(),
lang=get_lang(),
),
)
) as page_hash:

View File

@@ -8,7 +8,7 @@ from ...typedefs import Lang, Number
class Base(BaseModel):
_lang: Lang
lang: Lang
class Avatar(BaseModel):