Wechat v0.4.8 Wechat.Message
Message APIs.
Link to this section Summary
Functions
Send custom message by type.
Send image message.
发送图文消息(点击跳转到图文消息页面) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。
Send music message.
发送图文消息(点击跳转到外链) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。
Send text message.
Send video message.
Send voice message.
Send template message.
Link to this section Functions
custom_send(client, openid, type, content)
Send custom message by type.
custom_send_image(client, openid, media_id)
Send image message.
custom_send_miniprogrampage(client, openid, appid, pagepath, thumb_media_id, title \\ "")
发送小程序
content
: %{
title: "title",
appid: "appid",
pagepath: "pagepath",
thumb_media_id: "thumb_media_id"
}
custom_send_mpnews(client, openid, media_id)
发送图文消息(点击跳转到图文消息页面) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。
custom_send_music(client, openid, musicurl, hqmusicurl, thumb_media_id, opts \\ [])
Send music message.
opts
:
title: Music title.
description: Music description.
custom_send_news(client, openid, article)
发送图文消息(点击跳转到外链) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。
articles: [%{title: "", description: "", url: "", picurl: ""}]
custom_send_text(client, openid, content)
Send text message.
custom_send_video(client, openid, media_id, thumb_media_id, opts \\ [])
Send video message.
opts
:
title: Video title.
description: Video description.
custom_send_voice(client, openid, media_id)
Send voice message.
custom_send_wxcard(client, openid, card_id)
发送卡券
custom_typing_cancel(client, openid)
custom_typing_start(client, openid)
template_send(client, openid, template_id, data, opts \\ [])
Send template message.
data
: %{ // 模版数据
key: %{ // 模版中的key
value: // 对应的value
color: // 模板内容字体颜色,不填默认为黑色
} }
opts
:
url: 模板跳转链接(海外帐号没有跳转能力)
miniprogram: %{ // 跳小程序所需数据,不需跳小程序可不用传该数据
appid: "xiaochengxuappid12345" // 所需跳转到的小程序appid,
pagepath: "index?foo=bar" // 所需跳转到小程序的具体页面路径,支持带参数
}