获取当前用户频道列表

使用示例

sync

  1. import qqbot
  2. token = qqbot.Token({appid}, {token})
  3. def demo():
  4. api = qqbot.UserAPI(token, False)
  5. guilds = api.me_guilds()

async

  1. import qqbot
  2. token = qqbot.Token({appid}, {token})
  3. async def demo():
  4. api = qqbot.AsyncUserAPI(token, False)
  5. guilds = await api.me_guilds()

参数说明

字段名 必填 类型 描述
options ReqOptions 获取频道列表范围

ReqOptions

字段名 必填 类型 描述
before string 读取此 guild id 之前的数据
after string 读取此 guild id 之后的数据
limit number 每次拉取多少条数据,最大不超过 100,默认 100

::: warning 注意

before、after 同时存在时,以 before 为准。

:::

返回说明

返回 Guild 数组。

Guild

字段名 类型 描述
id string 频道 ID
name string 频道名称
icon string 频道头像地址
owner boolean 当前人是否是创建人

返回示例

data

  1. [
  2. {
  3. "id": 'xxxxxx',
  4. "name": 'Ost测试频道',
  5. "icon": 'xxxxxx',
  6. "owner": false,
  7. },
  8. ];