创建频道公告推荐子频道

用于将指定子频道设置为当前频道的推荐子频道,并以全局公告形式展示。

::: warning 注意

  • 同频道内推荐子频道最多只能创建 3 条。
  • 推荐子频道和全局公告不能同时存在,会互相顶替设置。
  • 只有子频道权限为全体成员可见才可设置为推荐子频道。
  • 删除频道公告推荐子频道请使用 删除频道公告,并将 messageId 设置为 all

:::

使用示例

  1. async function demo() {
  2. let { data } = await client.announceApi.postGuildRecommend(guildId, recommendObj);
  3. }

参数说明

字段名 必填 类型 描述
guildId string 频道 ID
recommendObj RecommendObj 推荐子频道设置对象

RecommendObj

字段名 必填 类型 描述
announces_type number 公告类别 0:成员公告,1:欢迎公告,默认为成员公告
recommend_channels RecommendChannel[] 推荐子频道列表

RecommendChannel

字段名 类型 描述
channel_id string 子频道 ID
introduce string 推荐语

返回说明

返回 Announce 对象。

Announce

字段名 类型 描述
guild_id string 频道 ID
channel_id string 子频道 ID
message_id string 消息 ID
announce_type number 推荐类别 0:成员公告; 1:欢迎公告
recommend_channels RecommendChannel[] 数组 推荐子频道详情列表

返回示例

data

  1. {
  2. "guild_id": "xxxxxx",
  3. "channel_id": "xxxxx",
  4. "message_id": "",
  5. "announces_type": 1,
  6. "recommend_channels": [
  7. {
  8. "channel_id": "xxxx",
  9. "introduce": "推荐语"
  10. },
  11. {
  12. "channel_id": "xxxx",
  13. "introduce": "推荐语"
  14. }
  15. ]
  16. }