Documentation
¶
Overview ¶
Package appchat 应用发送消息到群聊会话,企业微信接口:https://developer.work.weixin.qq.com/document/path/90248
Index ¶
- type Client
- func (r *Client) Send(apiName string, request interface{}) (*SendResponse, error)
- func (r *Client) SendImage(request SendImageRequest) (*SendResponse, error)
- func (r *Client) SendText(request SendTextRequest) (*SendResponse, error)
- func (r *Client) SendVoice(request SendVoiceRequest) (*SendResponse, error)
- type ImageField
- type SendImageRequest
- type SendRequestCommon
- type SendResponse
- type SendTextRequest
- type SendVoiceRequest
- type TextField
- type VoiceField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client 接口实例
func (*Client) Send ¶
func (r *Client) Send(apiName string, request interface{}) (*SendResponse, error)
Send 发送应用消息 @desc 实现企业微信发送应用消息接口:https://developer.work.weixin.qq.com/document/path/90248
func (*Client) SendImage ¶
func (r *Client) SendImage(request SendImageRequest) (*SendResponse, error)
SendImage 发送图片消息
func (*Client) SendText ¶
func (r *Client) SendText(request SendTextRequest) (*SendResponse, error)
SendText 发送文本消息
func (*Client) SendVoice ¶
func (r *Client) SendVoice(request SendVoiceRequest) (*SendResponse, error)
SendVoice 发送语音消息
type ImageField ¶
type ImageField struct {
// 图片媒体文件id,可以调用上传临时素材接口获取
MediaID string `json:"media_id"`
}
ImageField 图片消息参数
type SendImageRequest ¶
type SendImageRequest struct {
*SendRequestCommon
Image ImageField `json:"image"`
}
SendImageRequest 发送图片消息的请求
type SendRequestCommon ¶
type SendRequestCommon struct {
// 群聊id
ChatID string `json:"chatid"`
// 消息类型
MsgType string `json:"msgtype"`
// 表示是否是保密消息,0表示否,1表示是,默认0
Safe int `json:"safe"`
}
SendRequestCommon 发送应用推送消息请求公共参数
type SendTextRequest ¶
type SendTextRequest struct {
*SendRequestCommon
Text TextField `json:"text"`
}
SendTextRequest 发送文本消息的请求
type SendVoiceRequest ¶
type SendVoiceRequest struct {
*SendRequestCommon
Voice VoiceField `json:"voice"`
}
SendVoiceRequest 发送语音消息的请求
type TextField ¶
type TextField struct {
// 消息内容,最长不超过2048个字节
Content string `json:"content"`
}
TextField 文本消息参数
type VoiceField ¶
type VoiceField struct {
// 语音文件id,可以调用上传临时素材接口获取
MediaID string `json:"media_id"`
}
VoiceField 语音消息参数
Click to show internal directories.
Click to hide internal directories.