新增迎新操作

This commit is contained in:
李寻欢
2023-11-03 11:59:40 +08:00
parent 697f5560a4
commit d08937563a
3 changed files with 52 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ func Parse(remoteAddr net.Addr, msg []byte) {
// 消息撤回
case types.MsgTypeSys:
// 系统消息
go handleSysMessage(m)
default:
// 默认消息处理
groupUser = strings.Split(m.Content, "\n")[0]

19
handler/sys_message.go Normal file
View File

@@ -0,0 +1,19 @@
package handler
import (
"go-wechat/model"
"go-wechat/utils"
"strings"
)
// handleSysMessage
// @description: 系统消息处理
// @param m
func handleSysMessage(m model.Message) {
// 有人进群
if strings.Contains(m.Content, "\"邀请\"") && strings.Contains(m.Content, "\"加入了群聊") {
// 发一张图乐呵乐呵
// 自己欢迎自己图片地址 D:\Share\emoticon\welcome-yourself.gif
utils.SendImage(m.FromUser, "D:\\Share\\emoticon\\welcome-yourself.gif", 0)
}
}