🐛 修复错字,原神猜语音增加自定义时间配置项

This commit is contained in:
CMHopeSunshine 2022-09-28 14:14:42 +08:00
parent 4d2a333cdf
commit efcdeb9633
3 changed files with 7 additions and 4 deletions

View File

@ -71,3 +71,5 @@ class Config(BaseModel):
notice_event: bool = Field(True, alias='启用好友和群欢迎消息') notice_event: bool = Field(True, alias='启用好友和群欢迎消息')
screenshot_enable: bool = Field(True, alias='启用网页截图权限') screenshot_enable: bool = Field(True, alias='启用网页截图权限')
guess_voice_time: int = Field(30, alias='原神猜语音时间')

View File

@ -11,6 +11,7 @@ from nonebot.plugin import PluginMetadata
from LittlePaimon.utils.message import CommandCharacter, CommandLang, MessageBuild from LittlePaimon.utils.message import CommandCharacter, CommandLang, MessageBuild
from LittlePaimon.utils.alias import get_match_alias from LittlePaimon.utils.alias import get_match_alias
from LittlePaimon.database.models import GenshinVoice 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 .handler import GuessVoice, get_character_voice, get_rank, get_voice_list
from .resources import update_voice_resources 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) result = await get_rank(event.group_id)
await guess_voice.finish(result) await guess_voice.finish(result)
else: else:
game = GuessVoice(event.group_id, 30, lang) game = GuessVoice(event.group_id, pm.config.guess_voice_time, lang)
result = await game.start() result = await game.start()
await guess_voice.send('即将发送一段语音将在30秒后公布答案') await guess_voice.send('即将发送一段语音将在30秒后公布答案')
try: try:

View File

@ -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)): if info := info_file.get(str(chara_id)):
side_icon = info['SideIconName'] side_icon = info['SideIconName']
elif chara_id == '10000070': elif chara_id == '10000070':
side_icon = 'UI_AvatarIcon_Side_Nilou.png' side_icon = 'UI_AvatarIcon_Side_Nilou'
elif chara_id == '10000071': elif chara_id == '10000071':
side_icon = 'UI_AvatarIcon_Side_Cyno.png' side_icon = 'UI_AvatarIcon_Side_Cyno'
elif chara_id == '10000072': elif chara_id == '10000072':
side_icon = 'UI_AvatarIcon_Side_Candace.png' side_icon = 'UI_AvatarIcon_Side_Candace'
else: else:
return None return None
if icon_type == 'side': if icon_type == 'side':