diff --git a/LittlePaimon/manager/plugin_manager/model.py b/LittlePaimon/manager/plugin_manager/model.py index 3b2cd26..bff7a9c 100644 --- a/LittlePaimon/manager/plugin_manager/model.py +++ b/LittlePaimon/manager/plugin_manager/model.py @@ -71,3 +71,5 @@ class Config(BaseModel): notice_event: bool = Field(True, alias='启用好友和群欢迎消息') screenshot_enable: bool = Field(True, alias='启用网页截图权限') + + guess_voice_time: int = Field(30, alias='原神猜语音时间') diff --git a/LittlePaimon/plugins/Genshin_Voice/__init__.py b/LittlePaimon/plugins/Genshin_Voice/__init__.py index f942a4c..9c7391d 100644 --- a/LittlePaimon/plugins/Genshin_Voice/__init__.py +++ b/LittlePaimon/plugins/Genshin_Voice/__init__.py @@ -11,6 +11,7 @@ from nonebot.plugin import PluginMetadata from LittlePaimon.utils.message import CommandCharacter, CommandLang, MessageBuild from LittlePaimon.utils.alias import get_match_alias from LittlePaimon.database.models import GenshinVoice +from LittlePaimon.manager.plugin_manager import plugin_manager as pm from .handler import GuessVoice, get_character_voice, get_rank, get_voice_list from .resources import update_voice_resources @@ -59,7 +60,7 @@ async def _(event: GroupMessageEvent, msg: Message = CommandArg(), lang=CommandL result = await get_rank(event.group_id) await guess_voice.finish(result) else: - game = GuessVoice(event.group_id, 30, lang) + game = GuessVoice(event.group_id, pm.config.guess_voice_time, lang) result = await game.start() await guess_voice.send('即将发送一段语音,将在30秒后公布答案') try: diff --git a/LittlePaimon/utils/alias.py b/LittlePaimon/utils/alias.py index 80b0aa1..e3918f1 100644 --- a/LittlePaimon/utils/alias.py +++ b/LittlePaimon/utils/alias.py @@ -95,11 +95,11 @@ def get_chara_icon(name: Optional[str] = None, chara_id: Optional[int] = None, if info := info_file.get(str(chara_id)): side_icon = info['SideIconName'] elif chara_id == '10000070': - side_icon = 'UI_AvatarIcon_Side_Nilou.png' + side_icon = 'UI_AvatarIcon_Side_Nilou' elif chara_id == '10000071': - side_icon = 'UI_AvatarIcon_Side_Cyno.png' + side_icon = 'UI_AvatarIcon_Side_Cyno' elif chara_id == '10000072': - side_icon = 'UI_AvatarIcon_Side_Candace.png' + side_icon = 'UI_AvatarIcon_Side_Candace' else: return None if icon_type == 'side':