From 890217b450fb2244f79442b182d8cc9f15a6bc6a Mon Sep 17 00:00:00 2001 From: meatjam <851404658@qq.com> Date: Wed, 31 Aug 2022 14:50:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(Genshin=5FAIVoice):=20=E4=B8=BA=E8=A6=81?= =?UTF-8?q?=E8=AF=B4=E7=9A=84=E6=96=87=E6=9C=AC=E5=A2=9E=E5=8A=A0=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E5=B8=B8=E7=94=A8=E6=A0=87=E7=82=B9=E7=AD=89=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/plugins/Genshin_AIVoice/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/LittlePaimon/plugins/Genshin_AIVoice/__init__.py b/LittlePaimon/plugins/Genshin_AIVoice/__init__.py index 309f98f..39cb026 100644 --- a/LittlePaimon/plugins/Genshin_AIVoice/__init__.py +++ b/LittlePaimon/plugins/Genshin_AIVoice/__init__.py @@ -16,16 +16,17 @@ __plugin_meta__ = PluginMetadata( } ) -voice_cmd = on_regex(r'(?P\w*)说(?P\w+)', priority=20, block=True, state={ - 'pm_name': '原神语音合成', - 'pm_description': 'AI语音合成,让原神角色说任何话!', - 'pm_usage': '<角色名>说<话>', - 'pm_priority': 10 - }) +voice_cmd = on_regex(r'(?P\w*)说(?P[\w,。!?、:;“”‘’〔()〕——!\?,\.`\'"\(\)\[\]{}~\s]+)', priority=20, block=True, state={ + 'pm_name': '原神语音合成', + 'pm_description': 'AI语音合成,让原神角色说任何话!', + 'pm_usage': '<角色名>说<话>', + 'pm_priority': 10 +}) @voice_cmd.handle(parameterless=[Cooldown(cooldown=6, isolate_level=CooldownIsolateLevel.GROUP, prompt='冷却中...')]) async def _(event: Union[GroupMessageEvent, PrivateMessageEvent], regex_dict: dict = RegexDict()): + regex_dict['text'] = regex_dict['text'].replace('\r', '').replace('\n', '') if not regex_dict['chara']: regex_dict['chara'] = '派蒙' elif regex_dict['chara'] not in ['派蒙', '凯亚', '安柏', '丽莎', '琴', '香菱', '枫原万叶', '迪卢克', '温迪', '可莉', '早柚', '托马', '芭芭拉',