mirror of
https://github.com/silenceper/wechat.git
synced 2026-03-01 00:35:26 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41d3350249 |
@@ -79,10 +79,6 @@ type sendRequest struct {
|
|||||||
Mpnews map[string]interface{} `json:"mpnews,omitempty"`
|
Mpnews map[string]interface{} `json:"mpnews,omitempty"`
|
||||||
// 发送语音
|
// 发送语音
|
||||||
Voice map[string]interface{} `json:"voice,omitempty"`
|
Voice map[string]interface{} `json:"voice,omitempty"`
|
||||||
// 发送视频
|
|
||||||
Mpvideo map[string]interface{} `json:"mpvideo,omitempty"`
|
|
||||||
// 发送图片-预览使用
|
|
||||||
Image map[string]interface{} `json:"image,omitempty"`
|
|
||||||
// 发送图片
|
// 发送图片
|
||||||
Images *Image `json:"images,omitempty"`
|
Images *Image `json:"images,omitempty"`
|
||||||
// 发送卡券
|
// 发送卡券
|
||||||
@@ -187,13 +183,7 @@ func (broadcast *Broadcast) SendImage(user *User, images *Image) (*Result, error
|
|||||||
ToUser: nil,
|
ToUser: nil,
|
||||||
MsgType: MsgTypeImage,
|
MsgType: MsgTypeImage,
|
||||||
}
|
}
|
||||||
if broadcast.preview {
|
req.Images = images
|
||||||
req.Image = map[string]interface{}{
|
|
||||||
"media_id": images.MediaIDs[0],
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
req.Images = images
|
|
||||||
}
|
|
||||||
req, sendURL := broadcast.chooseTagOrOpenID(user, req)
|
req, sendURL := broadcast.chooseTagOrOpenID(user, req)
|
||||||
url := fmt.Sprintf("%s?access_token=%s", sendURL, ak)
|
url := fmt.Sprintf("%s?access_token=%s", sendURL, ak)
|
||||||
data, err := util.PostJSON(url, req)
|
data, err := util.PostJSON(url, req)
|
||||||
@@ -215,7 +205,7 @@ func (broadcast *Broadcast) SendVideo(user *User, mediaID string, title, descrip
|
|||||||
ToUser: nil,
|
ToUser: nil,
|
||||||
MsgType: MsgTypeVideo,
|
MsgType: MsgTypeVideo,
|
||||||
}
|
}
|
||||||
req.Mpvideo = map[string]interface{}{
|
req.Voice = map[string]interface{}{
|
||||||
"media_id": mediaID,
|
"media_id": mediaID,
|
||||||
"title": title,
|
"title": title,
|
||||||
"description": description,
|
"description": description,
|
||||||
|
|||||||
Reference in New Issue
Block a user