Compare commits
No commits in common. "5b187ff0262b7c03559927dee31d63132a800e2b" and "3bc33f1d648c58c6d4580a8d918ba6e05a62d97d" have entirely different histories.
5b187ff026
...
3bc33f1d64
@ -33,10 +33,6 @@ func Plugin() {
|
||||
dispatcher.RegisterHandler(func(m *dto.Message) bool {
|
||||
return m.Type == types.MsgTypeSys
|
||||
}, plugins.NotifyRemoveFromChatroom)
|
||||
// 响应好友添加成功消息
|
||||
dispatcher.RegisterHandler(func(m *dto.Message) bool {
|
||||
return m.Type == types.MsgTypeSys
|
||||
}, plugins.ReplyNewFriend)
|
||||
|
||||
// 私聊指令消息
|
||||
dispatcher.RegisterHandler(func(m *dto.Message) bool {
|
||||
|
@ -1,18 +0,0 @@
|
||||
package plugins
|
||||
|
||||
import (
|
||||
"go-wechat/plugin"
|
||||
"go-wechat/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ReplyNewFriend
|
||||
// @description: 响应好友添加成功消息
|
||||
// @param m
|
||||
func ReplyNewFriend(m *plugin.MessageContext) {
|
||||
isNewFriend := strings.HasPrefix(m.Content, "你已添加了") && strings.HasSuffix(m.Content, ",现在可以开始聊天了。")
|
||||
isNewChatroom := strings.Contains(m.Content, "\"邀请你加入了群聊,群聊参与人还有:")
|
||||
if isNewFriend || isNewChatroom {
|
||||
utils.SendMessage(m.FromUser, m.GroupUser, "AI正在初始化,请稍等几分钟,初始化完成之后我将主动告知您。", 0)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user