From f3a46a79f217a0bc9015a5ae20fb4061e5cc6d52 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:15:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20gocq=20=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E6=B6=88=E6=81=AF=E5=93=8D=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/platform/qq_gocq.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/model/platform/qq_gocq.py b/model/platform/qq_gocq.py index 01c741d..0abab00 100644 --- a/model/platform/qq_gocq.py +++ b/model/platform/qq_gocq.py @@ -123,10 +123,11 @@ async def handle_msg(self, message: Union[GroupMessage, FriendMessage, GuildMess if message.type == "GroupMessage": if i.qq == message.self_id: resp = True - for i in self.nick_qq: - if i != '' and i in message.message[0].text: - resp = True - break + elif isinstance(i, Plain): + for nick in self.nick_qq: + if nick != '' and message.message[0].text.strip().startwith(nick): + resp = True + break if not resp: return