获取频道详情

获取频道详情信息。

使用示例

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})

参数说明

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

返回说明

返回 Guild 对象。

Guild

字段名类型描述
idstring频道 ID
namestring频道名称
owner_idstring创建人用户 ID
ownerboolean当前人是否是创建人
member_countnumber成员数
max_membersnumber最大成员数
descriptionstring描述

返回示例

data

{
    "id":"guildId",
    "name":"频道名称",
    "owner_id":"owner_id",
    "owner":false,
    "member_count":8,
    "max_members":300,
    "description":""
}