From f74f3cc81b9dacce892b01334277e1bb69adb45a Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Tue, 7 Jun 2022 17:02:33 +0800 Subject: [PATCH] fix bug --- Guess_voice/__init__.py | 9 ++++----- Paimon_Gacha/__init__.py | 4 ++-- README.md | 4 ++++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Guess_voice/__init__.py b/Guess_voice/__init__.py index 33cf6a7..63434c5 100644 --- a/Guess_voice/__init__.py +++ b/Guess_voice/__init__.py @@ -1,9 +1,8 @@ import asyncio from pathlib import Path -from typing import Union 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.params import CommandArg 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) -async def download_voice(bot: Bot, event: Union[PrivateMessageEvent, GroupMessageEvent]): +async def download_voice(bot: Bot, event: MessageEvent): if not dir_name.exists(): dir_name.mkdir(parents=True, exist_ok=True) await bot.send(event, '资源尚未初始化,现在开始下载资源,这需要较长的时间,请耐心等待') @@ -72,7 +71,7 @@ async def guess_genshin_voice(bot: Bot, event: GroupMessageEvent, msg=CommandArg @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() if name.startswith('日'): language = '日' @@ -87,7 +86,7 @@ async def get_genshin_voice(bot: Bot, event: Union[PrivateMessageEvent, GroupMes @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 download_data.update_voice_data() await update_ys_voice.finish('原神语音资源更新完成') diff --git a/Paimon_Gacha/__init__.py b/Paimon_Gacha/__init__.py index 233a07e..157179a 100644 --- a/Paimon_Gacha/__init__.py +++ b/Paimon_Gacha/__init__.py @@ -1,5 +1,5 @@ import re -from typing import Dict, Union +from typing import Dict from nonebot import on_command, on_regex from nonebot.adapters.onebot.v11 import MessageEvent, GroupMessageEvent, Message @@ -35,7 +35,7 @@ lmt_user = FreqLimiter(config.paimon_gacha_cd_user) @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) init_user_info(uid) sender = event.sender diff --git a/README.md b/README.md index 12b7c5d..724ec47 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,10 @@ - 新增游戏内展柜角色面板卡片,使用`更新角色面板`来获取角色,`ysd角色名`来查看角色卡片 - 修复部分不记录上次查询的uid的bug - 大幅缩短深渊指令`sy`的缓存时间 ++ 6.6 + - 修复`模拟抽卡定轨`和`抽卡记录导出`bug ++ 6.7 + - 修复`原神猜语音`和`模拟抽卡`因`nonebot2.0.0b3`版本Union校验产生的bug,但`原神猜语音`将暂时无法私聊使用 ## 丨功能列表