This commit is contained in:
CMHopeSunshine 2022-06-07 17:02:33 +08:00
parent c71ce7fa5c
commit f74f3cc81b
3 changed files with 10 additions and 7 deletions

View File

@ -1,9 +1,8 @@
import asyncio import asyncio
from pathlib import Path from pathlib import Path
from typing import Union
from nonebot import on_command from nonebot import on_command
from nonebot.adapters.onebot.v11 import PrivateMessageEvent, GroupMessageEvent, MessageSegment, Bot from nonebot.adapters.onebot.v11 import GroupMessageEvent, MessageSegment, Bot, MessageEvent
from nonebot.exception import FinishedException from nonebot.exception import FinishedException
from nonebot.params import CommandArg from nonebot.params import CommandArg
from nonebot.permission import SUPERUSER from nonebot.permission import SUPERUSER
@ -23,7 +22,7 @@ ys_voice = on_command('原神语音', priority=12, block=True)
update_ys_voice = on_command('更新原神语音资源', priority=12, permission=SUPERUSER, block=True) update_ys_voice = on_command('更新原神语音资源', priority=12, permission=SUPERUSER, block=True)
async def download_voice(bot: Bot, event: Union[PrivateMessageEvent, GroupMessageEvent]): async def download_voice(bot: Bot, event: MessageEvent):
if not dir_name.exists(): if not dir_name.exists():
dir_name.mkdir(parents=True, exist_ok=True) dir_name.mkdir(parents=True, exist_ok=True)
await bot.send(event, '资源尚未初始化,现在开始下载资源,这需要较长的时间,请耐心等待') await bot.send(event, '资源尚未初始化,现在开始下载资源,这需要较长的时间,请耐心等待')
@ -72,7 +71,7 @@ async def guess_genshin_voice(bot: Bot, event: GroupMessageEvent, msg=CommandArg
@ys_voice.handle() @ys_voice.handle()
async def get_genshin_voice(bot: Bot, event: Union[PrivateMessageEvent, GroupMessageEvent], msg=CommandArg()): async def get_genshin_voice(bot: Bot, event: GroupMessageEvent, msg=CommandArg()):
name = str(msg).strip() name = str(msg).strip()
if name.startswith(''): if name.startswith(''):
language = '' language = ''
@ -87,7 +86,7 @@ async def get_genshin_voice(bot: Bot, event: Union[PrivateMessageEvent, GroupMes
@update_ys_voice.handle() @update_ys_voice.handle()
async def update_genshin_voice(bot: Bot, event: Union[PrivateMessageEvent, GroupMessageEvent]): async def update_genshin_voice(bot: Bot, event: GroupMessageEvent):
await update_ys_voice.send('将在后台开始更新原神语音资源,请耐心等待资源下载完成后再使用原神语音') await update_ys_voice.send('将在后台开始更新原神语音资源,请耐心等待资源下载完成后再使用原神语音')
await download_data.update_voice_data() await download_data.update_voice_data()
await update_ys_voice.finish('原神语音资源更新完成') await update_ys_voice.finish('原神语音资源更新完成')

View File

@ -1,5 +1,5 @@
import re import re
from typing import Dict, Union from typing import Dict
from nonebot import on_command, on_regex from nonebot import on_command, on_regex
from nonebot.adapters.onebot.v11 import MessageEvent, GroupMessageEvent, Message from nonebot.adapters.onebot.v11 import MessageEvent, GroupMessageEvent, Message
@ -35,7 +35,7 @@ lmt_user = FreqLimiter(config.paimon_gacha_cd_user)
@sim_gacha.handle() @sim_gacha.handle()
async def gacha(event: Union[MessageEvent, GroupMessageEvent], reGroup: Dict = RegexDict()): async def gacha(event: MessageEvent, reGroup: Dict = RegexDict()):
uid = str(event.user_id) uid = str(event.user_id)
init_user_info(uid) init_user_info(uid)
sender = event.sender sender = event.sender

View File

@ -87,6 +87,10 @@
- 新增游戏内展柜角色面板卡片,使用`更新角色面板`来获取角色,`ysd角色名`来查看角色卡片 - 新增游戏内展柜角色面板卡片,使用`更新角色面板`来获取角色,`ysd角色名`来查看角色卡片
- 修复部分不记录上次查询的uid的bug - 修复部分不记录上次查询的uid的bug
- 大幅缩短深渊指令`sy`的缓存时间 - 大幅缩短深渊指令`sy`的缓存时间
+ 6.6
- 修复`模拟抽卡定轨`和`抽卡记录导出`bug
+ 6.7
- 修复`原神猜语音`和`模拟抽卡`因`nonebot2.0.0b3`版本Union校验产生的bug但`原神猜语音`将暂时无法私聊使用
## 丨功能列表 ## 丨功能列表