View Source WeChat.Publish (wechat v0.15.1)

发布能力

Summary

Types

成功发布时返回的 article_id

发布任务的id

Types

@type article_id() :: String.t()

成功发布时返回的 article_id

@type publish_id() :: String.t()

发布任务的id

Functions

Link to this function

batch_get(client, count \\ 10, offset \\ 0, no_content \\ false)

View Source
@spec batch_get(
  WeChat.client(),
  count :: integer(),
  offset :: integer(),
  no_content :: boolean()
) ::
  WeChat.response()

获取成功发布列表 - 官方文档

开发者可以获取已成功发布的消息列表。

参数说明

  • offset: 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
  • count: 返回素材的数量,取值在1到20之间
  • no_content: 是否返回 content 字段
Link to this function

delete(client, article_id, index \\ 0)

View Source
@spec delete(WeChat.client(), article_id(), index :: integer()) :: WeChat.response()

删除发布 - 官方文档

开发者可以尝试通过下面的发布状态轮询接口获知发布情况。

参数说明

  • index: 要删除的文章在图文消息中的位置,第一篇编号为1,该字段不填或填0会删除全部文章
Link to this function

get_article(client, article_id)

View Source
@spec get_article(WeChat.client(), article_id()) :: WeChat.response()

通过 article_id 获取已发布文章 - 官方文档

开发者可以通过 article_id 获取已发布的图文信息。

Link to this function

get_status(client, publish_id)

View Source
@spec get_status(WeChat.client(), publish_id()) :: WeChat.response()

发布状态轮询接口 - 官方文档

开发者可以尝试通过下面的发布状态轮询接口获知发布情况。

Link to this function

publish(client, media_id)

View Source

发布接口 - 官方文档

开发者需要先将图文素材以草稿的形式保存(见“草稿箱/新建草稿”,如需从已保存的草稿中选择,见“草稿箱/获取草稿列表”),选择要发布的草稿 media_id 进行发布

Link to this function

stream_get(client, count \\ 20, no_content \\ false)

View Source
@spec stream_get(WeChat.client(), count :: integer(), no_content :: boolean()) ::
  Enumerable.t()

获取成功发布列表(stream) - 官方文档

开发者可以获取已成功发布的消息列表。

参数说明

  • count: 返回素材的数量,取值在1到20之间
  • no_content: 是否返回 content 字段