From cae9dc5c7888fbe03bab17a0b34935b328e81315 Mon Sep 17 00:00:00 2001 From: taylor Date: Sun, 13 Oct 2024 19:38:13 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E5=91=BD=E4=BB=A4ai?= =?UTF-8?q?=20model=20list=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maubot_llmplus/aibot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index eafb3ad..d044228 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -76,7 +76,7 @@ class AiBotPlugin(Plugin): return False # 如果发送的消息中,第一个字符是感叹号,不进行回复 - if event.content[0] == '!': + if event.content.body[0] == '!': return False # 判断这个用户是否在允许列表中, 不存在返回False @@ -90,7 +90,7 @@ class AiBotPlugin(Plugin): return False # 检查是否发送消息中有带上机器人的别名 - if re.search("(^|\s)(@)?" + self.name + "([ :,.!?]|$)", event.content.body, re.IGNORECASE): + if re.search("(^|\\s)(@)?" + self.name + "([ :,.!?]|$)", event.content.body, re.IGNORECASE): return True # 当聊天室只有两个人并且其中一个是机器人时