肯德基疯狂星期四文案指令新增支持群消息

This commit is contained in:
李寻欢
2023-12-22 09:58:27 +08:00
parent 3fcbbd3308
commit 6d127d1492
5 changed files with 86 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import (
"go-wechat/model"
plugin "go-wechat/plugin"
"go-wechat/plugin/plugins"
"go-wechat/service"
)
// Plugin
@@ -24,8 +25,8 @@ func Plugin() {
// 私聊指令消息
dispatcher.RegisterHandler(func(m *model.Message) bool {
// 私聊消息直接进去
return m.IsPrivateText()
// 私聊消息 或 群聊艾特机器人并且以/开头的消息
return (m.IsPrivateText() || (m.IsAt() && m.CleanContentStartWith("/"))) && service.CheckIsEnableCommand(m.FromUser)
}, plugins.Command)
// AI消息插件