Compare commits

...

2 Commits

Author SHA1 Message Date
李寻欢
791f0a550a Merge pull request '🎨 优化@所有人判断逻辑' (#86) from hotfix into main
Reviewed-on: https://gitee.ltd/lxh/go-wxhelper/pulls/86
2024-07-22 09:08:44 +08:00
李寻欢
6acc0db583 🎨 优化@所有人判断逻辑 2024-07-22 09:08:02 +08:00

View File

@@ -160,7 +160,11 @@ func (m Message) IsAtAll() bool {
// 转换@用户列表为数组 // 转换@用户列表为数组
atUserList := strings.Split(d.AtUserList, ",") atUserList := strings.Split(d.AtUserList, ",")
// 判断是否包含@所有人 // 判断是否包含@所有人
return slice.Contain(atUserList, "notify@all") if slice.Contain(atUserList, "notify@all") {
return true
}
// 数据格式变动,再检查一下字符串是否包含 @所有人 字样
return m.IsAt() && strings.Contains(m.Content, "@所有人")
} }
// IsPrivateText // IsPrivateText