Wechat v0.4.8 Wechat.Message

Message APIs.

Link to this section Summary

Functions

Send custom message by type.

发送图文消息(点击跳转到图文消息页面) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。

发送图文消息(点击跳转到外链) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。

Link to this section Functions

Link to this function

custom_send(client, openid, type, content)

Send custom message by type.

Link to this function

custom_send_image(client, openid, media_id)

Send image message.

Link to this function

custom_send_miniprogrampage(client, openid, appid, pagepath, thumb_media_id, title \\ "")

发送小程序

content: %{ title: "title", appid: "appid", pagepath: "pagepath", thumb_media_id: "thumb_media_id" }

Link to this function

custom_send_mpnews(client, openid, media_id)

发送图文消息(点击跳转到图文消息页面) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。

Link to this function

custom_send_msgmenu(client, openid, content)

发送菜单消息

content: %{head_content: "", list: [%{id: "", content: ""}], tail_content: ""}

Link to this function

custom_send_music(client, openid, musicurl, hqmusicurl, thumb_media_id, opts \\ [])

Send music message.

opts: title: Music title. description: Music description.

Link to this function

custom_send_news(client, openid, article)

发送图文消息(点击跳转到外链) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。

articles: [%{title: "", description: "", url: "", picurl: ""}]

Link to this function

custom_send_text(client, openid, content)

Send text message.

Link to this function

custom_send_video(client, openid, media_id, thumb_media_id, opts \\ [])

Send video message.

opts: title: Video title. description: Video description.

Link to this function

custom_send_voice(client, openid, media_id)

Send voice message.

Link to this function

custom_send_wxcard(client, openid, card_id)

发送卡券

Link to this function

custom_typing_cancel(client, openid)

Link to this function

custom_typing_start(client, openid)

Link to this function

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" // 

}