From f86e2deee32394d23d1935897cb17ff590b04c8d Mon Sep 17 00:00:00 2001 From: zihanjian Date: Thu, 17 Jul 2025 17:02:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8F=90=E9=86=92=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=AF=B9?= =?UTF-8?q?=E5=81=87=E5=8C=B9=E9=85=8D=E5=AF=B9=E8=B1=A1=E7=9A=84=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=8C=E7=9B=B4=E6=8E=A5=E4=BC=A0=E9=80=92=20None?= =?UTF-8?q?=20=E4=BD=9C=E4=B8=BA=E5=8F=82=E6=95=B0=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E4=BB=A3=E7=A0=81=E7=AE=80=E6=B4=81=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E5=8F=AF=E8=AF=BB=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/ai_functions.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/commands/ai_functions.py b/commands/ai_functions.py index e4da47a..b77e837 100644 --- a/commands/ai_functions.py +++ b/commands/ai_functions.py @@ -126,16 +126,13 @@ def ai_handle_reminder_set(ctx: MessageContext, params: str) -> bool: # 调用原有的提醒处理逻辑 from .handlers import handle_reminder - # 构造一个假的match对象,因为AI路由不使用正则匹配 - class FakeMatch: - def group(self, n): - return params # 临时修改消息内容以适配原有处理器 original_content = ctx.msg.content ctx.msg.content = f"提醒我{params}" - result = handle_reminder(ctx, FakeMatch()) + # handle_reminder不使用match参数,直接传None + result = handle_reminder(ctx, None) # 恢复原始内容 ctx.msg.content = original_content @@ -180,12 +177,8 @@ def ai_handle_reminder_delete(ctx: MessageContext, params: str) -> bool: original_content = ctx.msg.content ctx.msg.content = f"删除提醒 {params}" - # 构造假的match对象 - class FakeMatch: - def group(self, n): - return params - - result = handle_delete_reminder(ctx, FakeMatch()) + # handle_delete_reminder不使用match参数,直接传None + result = handle_delete_reminder(ctx, None) # 恢复原始内容 ctx.msg.content = original_content