View Source WeChat.DraftBox (wechat v0.15.1)

草稿箱

Summary

Types

草稿箱的media_id

Types

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

草稿箱的media_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 字段
@spec count(WeChat.client()) :: WeChat.response()

获取草稿总数 - 官方文档

开发者可以根据本接口来获取草稿的总数。此接口只统计数量,不返回草稿的具体内容。

Link to this function

delete(client, media_id)

View Source
@spec delete(WeChat.client(), media_id()) :: WeChat.response()

删除草稿 - 官方文档

新增草稿后,开发者可以根据本接口来删除不再需要的草稿,节省空间。此操作无法撤销,请谨慎操作。

@spec get(WeChat.client(), media_id()) :: WeChat.response()

获取草稿 - 官方文档

新增草稿后,开发者可以根据草稿指定的字段来下载草稿。

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 字段
Link to this function

update(client, media_id, article, index \\ 0)

View Source
@spec update(
  WeChat.client(),
  media_id(),
  WeChat.Material.Article.t(),
  index :: integer()
) ::
  WeChat.response()

修改草稿 - 官方文档

开发者可通过本接口对草稿进行修改。