消息群发

获取群发操作实例

oa := wc.GetOfficialAccount(cfg)
bd:=oa.GetBroadcast()
//TODO bd.SendText

发送对象

  • 发送方法的第一个参数为broadcast.User对象,为nil则表示发送给所有人
  • broadcast.User{TagID:1} : 根据tagID发送
  • `broadcast.User{OpenID:[]string{"openid-1","openid-2"}}`` :根据openid发送

群发消息类型

发送文本消息

bd.SendText(user *User, content string)

发送图文

bd.SendNews(user *User, mediaID string,ignoreReprint bool)

发送图片

bd.SendImage(user *User, images *Image)

发送语音

bd.SendVoice(user *User, mediaID string)

发送视频

bd.SendVideo(user *User, mediaID string,title,description string)
Copyright © Wechat SDK For Go 2020 all right reserved,powered by Gitbook该文件修订时间: 2020-05-30 08:12:07

results matching ""

    No results matching ""