forked from lxh/go-wxhelper
🐛 Fix a bug.
This commit is contained in:
parent
ccb0216484
commit
43ddd23258
@ -24,9 +24,8 @@ func Parse(remoteAddr net.Addr, msg []byte) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 提取出群成员信息
|
// 提取出群成员信息
|
||||||
//groupUser := ""
|
// Sys类型的消息正文不包含微信 Id,所以不需要处理
|
||||||
//msgStr := m.Content
|
if m.IsGroup() && m.Type != types.MsgTypeSys {
|
||||||
if strings.Contains(m.FromUser, "@") {
|
|
||||||
// 群消息,处理一下消息和发信人
|
// 群消息,处理一下消息和发信人
|
||||||
groupUser := strings.Split(m.Content, "\n")[0]
|
groupUser := strings.Split(m.Content, "\n")[0]
|
||||||
groupUser = strings.ReplaceAll(groupUser, ":", "")
|
groupUser = strings.ReplaceAll(groupUser, ":", "")
|
||||||
|
@ -33,6 +33,10 @@ type systemMsgDataXml struct {
|
|||||||
// @description: 消息主体
|
// @description: 消息主体
|
||||||
type sysMsg struct{}
|
type sysMsg struct{}
|
||||||
|
|
||||||
|
func (m Message) IsGroup() bool {
|
||||||
|
return strings.HasSuffix(m.FromUser, "@chatroom")
|
||||||
|
}
|
||||||
|
|
||||||
// IsPat
|
// IsPat
|
||||||
// @description: 是否是拍一拍消息
|
// @description: 是否是拍一拍消息
|
||||||
// @receiver m
|
// @receiver m
|
||||||
|
Loading…
Reference in New Issue
Block a user