# 获取频道详情

获取频道详情信息。

# 使用示例

import botpy
from botpy.message import Message

class MyClient(botpy.Client):
    async def on_at_message_create(self, message: Message):
        await self.api.get_guild(guild_id="xxxx")

intents = botpy.Intents(public_guild_messages=True)
client = MyClient(intents=intents)
client.run(appid={appid}, token={token})
1
2
3
4
5
6
7
8
9
10

# 参数说明

字段名 必填 类型 描述
guild_id string 频道 ID

# 返回说明

返回 Guild 对象。

# Guild

字段名 类型 描述
id string 频道 ID
name string 频道名称
owner_id string 创建人用户 ID
owner boolean 当前人是否是创建人
member_count number 成员数
max_members number 最大成员数
description string 描述

# 返回示例

data

{
    "id":"guildId",
    "name":"频道名称",
    "owner_id":"owner_id",
    "owner":false,
    "member_count":8,
    "max_members":300,
    "description":""
}
1
2
3
4
5
6
7
8
9
手机QQ扫码
开发者社区
加入官方频道开发者社区