Documentation ¶
Index ¶
- Constants
- func CmdMiniSendCustomer(arg *CmdMiniSendCustomerParams) error
- func CmdMpSendCustomer(arg *CmdMpSendCustomerParams) error
- func SendCustomer(accessToken string, msg *CustomerMessage) error
- func ValidateMiniProgramMsgType(v string) error
- func ValidateMpMsgType(v string) error
- type Article
- type CmdMiniSendCustomerParams
- type CmdMpSendCustomerParams
- type CustomerMessage
- type ImageMeta
- type LinkMeta
- type MiniProgramPageMeta
- type MpNewsArticleMeta
- type MpNewsMeta
- type MsgMenuItem
- type MsgMenuMeta
- type MusicMeta
- type NewsMeta
- type ServiceMeta
- type TextMeta
- type VideoMeta
- type VoiceMeta
- type WxCardMeta
Constants ¶
View Source
const ( MiniProgramMsgTypeText = "text" // 文本消息 MiniProgramMsgTypeImage = "image" // 图片消息 MiniProgramMsgTypeLink = "link" // 图文链接 MiniProgramMsgTypeMiniProgramPage = "miniprogrampage" // 小程序卡片 )
小程序 msgtype 的合法值
View Source
const ( MpMsgTypeText = "text" // 文本消息 MpMsgTypeImage = "image" // 图片消息 MpMsgTypeVoice = "voice" // 语音消息 MpMsgTypeVideo = "video" // 视频消息 MpMsgTypeMusic = "music" // 音乐消息 MpMsgTypeNews = "news" // 图文消息(点击跳转到外链) MpMsgTypeMpNews = "mpnews" // 图文消息(点击跳转到图文消息页面) MpMsgTypeMpNewsArticle = "mpnewsarticle" // 图文消息(点击跳转到图文消息页面)使用通过 “发布” 系列接口得到的 article_id MpMsgTypeMsgMenu = "msgmenu" // 菜单消息 MpMsgTypeWxCard = "wxcard" // 卡券 MpMsgTypeMiniProgramPage = "miniprogrampage" // 小程序卡片(要求小程序与公众号已关联) )
公众号 msgtype 的合法值
Variables ¶
This section is empty.
Functions ¶
func CmdMiniSendCustomer ¶
func CmdMiniSendCustomer(arg *CmdMiniSendCustomerParams) error
CmdMiniSendCustomer 发送微信小程序客服消息
func CmdMpSendCustomer ¶
func CmdMpSendCustomer(arg *CmdMpSendCustomerParams) error
CmdMpSendCustomer 发送微信公众号客服消息
func SendCustomer ¶
func SendCustomer(accessToken string, msg *CustomerMessage) error
SendCustomer 发送微信客服消息
func ValidateMiniProgramMsgType ¶
ValidateMiniProgramMsgType 验证
Types ¶
type Article ¶
type Article struct { Title string `json:"title"` Description string `json:"description"` Url string `json:"url"` PicUrl string `json:"picurl"` }
Article 图文内容(点击跳转到外链)
type CmdMiniSendCustomerParams ¶
type CmdMiniSendCustomerParams struct { UserAgent string AccessToken string AppID string AppSecret string ToUser string MsgType string Data string }
func (*CmdMiniSendCustomerParams) Validate ¶
func (t *CmdMiniSendCustomerParams) Validate() error
type CmdMpSendCustomerParams ¶
type CmdMpSendCustomerParams struct { UserAgent string AccessToken string AppID string AppSecret string ToUser string MsgType string KfAccount string Data string }
func (*CmdMpSendCustomerParams) Validate ¶
func (t *CmdMpSendCustomerParams) Validate() error
type CustomerMessage ¶
type CustomerMessage struct { ToUser string `json:"touser"` MsgType string `json:"msgtype"` CustomService *ServiceMeta `json:"customservice,omitempty"` Text *TextMeta `json:"text,omitempty"` Image *ImageMeta `json:"image,omitempty"` Voice *VoiceMeta `json:"voice,omitempty"` Video *VideoMeta `json:"video,omitempty"` Music *MusicMeta `json:"music,omitempty"` News *NewsMeta `json:"news,omitempty"` MpNews *MpNewsMeta `json:"mpnews,omitempty"` MpNewsArticle *MpNewsArticleMeta `json:"mpNewsArticle,omitempty"` MsgMenu *MsgMenuMeta `json:"msgmenu,omitempty"` WxCard *WxCardMeta `json:"wxcard,omitempty"` MiniProgramPage *MiniProgramPageMeta `json:"miniprogrampage,omitempty"` Link *LinkMeta `json:"link,omitempty"` }
CustomerMessage 微信客服消息
type LinkMeta ¶
type LinkMeta struct { Title string `json:"title"` Description string `json:"description"` Url string `json:"url"` ThumbUrl string `json:"thumb_url"` }
LinkMeta 图文链接
type MiniProgramPageMeta ¶
type MiniProgramPageMeta struct { Title string `json:"title"` AppID string `json:"appid,omitempty"` // 小程序发送不需要填写 PagePath string `json:"pagepath"` ThumbMediaID string `json:"thumb_media_id"` }
MiniProgramPageMeta 小程序卡片(要求小程序与公众号已关联)
type MpNewsArticleMeta ¶
type MpNewsArticleMeta struct {
ArticleID string `json:"article_id"`
}
MpNewsArticleMeta 图文消息(点击跳转到图文消息页面)使用通过 “发布” 系列接口得到的 article_id
type MpNewsMeta ¶
type MpNewsMeta struct {
MediaID string `json:"media_id"`
}
MpNewsMeta 图文(点击跳转到图文消息页面)
type MsgMenuItem ¶
MsgMenuItem 菜单内容
type MsgMenuMeta ¶
type MsgMenuMeta struct { HeadContent string `json:"head_content"` List []MsgMenuItem `json:"list"` TailContent string `json:"tail_content"` }
MsgMenuMeta 菜单消息
type MusicMeta ¶
type MusicMeta struct { Title string `json:"title"` Description string `json:"description"` MusicUrl string `json:"musicurl"` HqmusicUrl string `json:"hqmusicurl"` ThumbMediaID string `json:"thumb_media_id"` }
MusicMeta 音乐
type ServiceMeta ¶
type ServiceMeta struct {
KfAccount string `json:"kf_account"`
}
ServiceMeta 客服帐号 如果需要以某个客服帐号来发消息(在微信6.0.2及以上版本中显示自定义头像),则需在 JSON 数据包的后半部分加入 customservice 参数
type VideoMeta ¶
type VideoMeta struct { MediaID string `json:"media_id"` ThumbMediaID string `json:"thumb_media_id"` Title string `json:"title"` Description string `json:"description"` }
VideoMeta 视频
type WxCardMeta ¶
type WxCardMeta struct {
CardID string `json:"card_id"`
}
WxCardMeta 卡券消息 特别注意客服消息接口投放卡券仅支持非自定义 Code 码和导入 code 模式的卡券的卡券
Click to show internal directories.
Click to hide internal directories.