From 77c5a96c7617c7b76c021c2c498966009d361de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Fri, 12 Jan 2024 21:50:56 +0800 Subject: [PATCH] :bug: Fix a bug. #7 --- initialization/plugin.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/initialization/plugin.go b/initialization/plugin.go index 269dc1f..515fd51 100644 --- a/initialization/plugin.go +++ b/initialization/plugin.go @@ -26,13 +26,14 @@ func Plugin() { // 私聊指令消息 dispatcher.RegisterHandler(func(m *model.Message) bool { // 私聊消息 或 群聊艾特机器人并且以/开头的消息 - return (m.IsPrivateText() || (m.IsAt() && !m.IsAtAll() && m.CleanContentStartWith("/"))) && service.CheckIsEnableCommand(m.FromUser) + isGroupAt := m.IsAt() && !m.IsAtAll() + return (m.IsPrivateText() || isGroupAt) && m.CleanContentStartWith("/") && service.CheckIsEnableCommand(m.FromUser) }, plugins.Command) // AI消息插件 dispatcher.RegisterHandler(func(m *model.Message) bool { // 群内@或者私聊文字消息 - return m.IsAt() && !m.IsAtAll() || m.IsPrivateText() + return (m.IsAt() && !m.IsAtAll()) || m.IsPrivateText() }, plugins.AI) // 欢迎新成员