From 00c233bc28db09ab958be4446149a56ffb075a03 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 28 Apr 2024 23:41:25 +0800 Subject: [PATCH] :art: Increase avatars plugin max count --- plugins/genshin/avatar_list.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/genshin/avatar_list.py b/plugins/genshin/avatar_list.py index 9b9cc5f6..2cffd7a8 100644 --- a/plugins/genshin/avatar_list.py +++ b/plugins/genshin/avatar_list.py @@ -25,6 +25,8 @@ if TYPE_CHECKING: from telegram import Update from telegram.ext import ContextTypes +MAX_AVATAR_COUNT = 40 + class SkillData(Model): """天赋数据""" @@ -170,7 +172,7 @@ class AvatarListPlugin(Plugin): await message.reply_chat_action(ChatAction.TYPING) characters = await client.get_genshin_characters(client.player_id) avatar_datas: List[AvatarData] = await self.get_avatars_data( - characters, client, None if all_avatars else 20 + characters, client, None if all_avatars else MAX_AVATAR_COUNT ) except SimnetBadRequest as e: if notice: @@ -193,7 +195,7 @@ class AvatarListPlugin(Plugin): "has_more": len(characters) != len(avatar_datas), # 是否显示了全部角色 } - as_document = all_avatars and len(characters) > 20 + as_document = all_avatars and len(characters) > MAX_AVATAR_COUNT await message.reply_chat_action(ChatAction.UPLOAD_DOCUMENT if as_document else ChatAction.UPLOAD_PHOTO)