Skip to content

企业微信机器人@指定人员的问题 #486

@yhgroup

Description

@yhgroup

企业微信群机器人说明中@指定人员支持mentioned_list或mentioned_mobile_list,但weixin.go中好些不是这样处理的!
https://developer.work.weixin.qq.com/document/path/99110

weixin.go
`func PostToWeiXin(text, WXurl, atuserid, logsign string) string {
open := beego.AppConfig.String("open-weixin")
if open != "1" {
logs.Info(logsign, "[weixin]", "企业微信接口未配置未开启状态,请先配置open-weixin为1")
return "企业微信接口未配置未开启状态,请先配置open-weixin为1"
}

SendContent := text
if atuserid != "" {
	userid := strings.Split(atuserid, ",")
	idtext := ""
	for _, id := range userid {
		idtext += "<@" + id + ">"
	}
	SendContent += idtext
}
u := WXMessage{
	Msgtype:  "markdown",
	Markdown: Mark{Content: SendContent},
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions