创建频道公告推荐子频道
用于将子频道设置为频道内推荐子频道的全局公告。
::: warning 注意
- 同频道内推荐子频道最多只能创建
3条。 - 推荐子频道和全局公告不能同时存在,会互相顶替设置。
- 只有子频道权限为全体成员可见才可设置为推荐子频道。
- 删除频道公告推荐子频道请使用 删除频道公告,并将
message_id设置为all。
:::
使用示例
async function demo() {let { data } = await client.announceApi.patchGuildRecommend(guildId, recommendObj);}
参数说明
| 字段名 | 必填 | 类型 | 描述 |
|---|---|---|---|
| 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:
{"guild_id": "xxxxxx","channel_id": "xxxxx","message_id": "","announces_type": 1,"recommend_channels": [{"channel_id": "xxxx","introduce": "推荐语"},{"channel_id": "xxxx","introduce": "推荐语"}]}
