From 05848f80e6826b96fce69931bac59d25a875909e Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Fri, 9 Sep 2022 22:38:55 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20`=E7=BE=A4=E8=81=8A=E5=AD=A6?= =?UTF-8?q?=E4=B9=A0`=E4=B8=8D=E5=AD=A6=E8=A7=86=E9=A2=91=E3=80=81?= =?UTF-8?q?=E5=88=86=E4=BA=AB=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/plugins/Learning_Chat/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LittlePaimon/plugins/Learning_Chat/models.py b/LittlePaimon/plugins/Learning_Chat/models.py index b3b4453..b37f553 100644 --- a/LittlePaimon/plugins/Learning_Chat/models.py +++ b/LittlePaimon/plugins/Learning_Chat/models.py @@ -407,7 +407,7 @@ class LearningChat: continue if not self.message.to_me and sample_msg.startswith(NICKNAME): continue - if sample_msg.startswith(('[CQ:xml', '[CQ:json', '[CQ:at')): + if any(i in sample_msg for i in{'[CQ:xml', '[CQ:json', '[CQ:at', '[CQ:video', '[CQ:record', '[CQ:share'}): # 不学xml、json和at continue @@ -446,7 +446,7 @@ class LearningChat: # 回复别人的,不学 if '[CQ:reply' in self.message.raw_message: return - if context := await Context.get_or_none(keywords=pre_msg['keywords']): + if context := await Context.filter(keywords=pre_msg['keywords']).first(): context.count += 1 context.time = self.message.time answer_index = next((idx for idx, answer in enumerate(context.answers)