From 4de8c5ed7d080b91f91a082e4eea90637bdc3212 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Mon, 3 Apr 2023 21:13:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E6=A8=A1=E5=9E=8B=E4=B8=8Bupdate=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E6=97=A0=E6=B3=95=E5=8F=91=E9=80=81=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/qqbot/core.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cores/qqbot/core.py b/cores/qqbot/core.py index 3fa662068..325d73373 100644 --- a/cores/qqbot/core.py +++ b/cores/qqbot/core.py @@ -451,7 +451,12 @@ def oper_msg(message, at=False, msg_ref = None): if len(command_result) == 3 and command_result[2] == 'image': for i in command_result[1]: send_qq_msg(message, i, image_mode=True, msg_ref=command_result[2]) - else: send_qq_msg(message, command_result[1], msg_ref=msg_ref) + else: + try: + send_qq_msg(message, command_result[1], msg_ref=msg_ref) + except BaseException as e: + t = command_result[1].replace(".", " . ") + send_qq_msg(message, t, msg_ref=msg_ref) else: send_qq_msg(message, f"指令调用错误: \n{command_result[1]}", msg_ref=msg_ref) return @@ -473,7 +478,11 @@ def oper_msg(message, at=False, msg_ref = None): hit, command_result = command_rev_chatgpt.check_command(qq_msg) if hit: if command_result != None and command_result[0]: - send_qq_msg(message, command_result[1], msg_ref=msg_ref) + try: + send_qq_msg(message, command_result[1], msg_ref=msg_ref) + except BaseException as e: + t = command_result[1].replace(".", " . ") + send_qq_msg(message, t, msg_ref=msg_ref) else: send_qq_msg(message, f"指令调用错误: \n{command_result[1]}", msg_ref=msg_ref) return