1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-07 06:02:26 +08:00
Files
wechat/work/kf/sendmsgonevent/message.go

56 lines
2.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package sendmsgonevent
// Message 发送事件响应消息
type Message struct {
Code string `json:"code"` // 事件响应消息对应的 code。通过事件回调下发仅可使用一次。
MsgID string `json:"msgid"` // 消息 ID。如果请求参数指定了 msgid则原样返回否则系统自动生成并返回。不多于 32 字节,不多于 32 字节
}
// Text 文本消息
type Text struct {
Message
MsgType string `json:"msgtype"` // 消息类型此时固定为text
Text struct {
Content string `json:"content"` // 消息内容,最长不超过 2048 个字节
} `json:"text"` // 文本消息
}
// Menu 发送菜单消息
type Menu struct {
Message
MsgType string `json:"msgtype"` // 消息类型此时固定为msgmenu
MsgMenu struct {
HeadContent string `json:"head_content"` // 消息内容,不多于 1024 字节
List []interface{} `json:"list"` // 菜单项配置,不能多余 10 个
TailContent string `json:"tail_content"` // 结束文本,不多于 1024 字
} `json:"msgmenu"`
}
// MenuClick 回复菜单
type MenuClick struct {
Type string `json:"type"` // 菜单类型click 回复菜单
Click struct {
ID string `json:"id"` // 菜单 ID, 不少于 1 字节,不多于 64 字节
Content string `json:"content"` // 菜单显示内容,不少于 1 字节,不多于 128 字节
} `json:"click"`
}
// MenuView 超链接菜单
type MenuView struct {
Type string `json:"type"` // 菜单类型view 超链接菜单
View struct {
URL string `json:"url"` // 点击后跳转的链接,不少于 1 字节,不多于 2048 字节
Content string `json:"content"` // 菜单显示内容,不少于 1 字节,不多于 1024 字节
} `json:"view"`
}
// MenuMiniProgram 小程序菜单
type MenuMiniProgram struct {
Type string `json:"type"` // 菜单类型miniprogram 小程序菜单
MiniProgram struct {
AppID string `json:"appid"` // 小程序 appid, 不少于 1 字节,不多于 32 字节
PagePath string `json:"pagepath"` // 点击后进入的小程序页面,不少于 1 字节,不多于 1024 字节
Content string `json:"content"` // 菜单显示内容,不少于 1 字节,不多于 1024 字节
} `json:"miniprogram"`
}