Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:pythonsdk 添加获取频道身份组的成员列表接口相关文档 #151

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions docs/develop/pythonsdk/api/member/get_guild_role_members.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 获取频道身份组的成员列表

获取频道下指定身份组的成员列表。

<PrivateDomain/>

## 使用示例

```python
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_role_member(guild_id="xxxx", role_id="xxxx")

intents = botpy.Intents(public_guild_messages=True)
client = MyClient(intents=intents)
client.run(appid={appid}, token={token})

```

## 参数说明

| 字段名 | 必填 | 类型 | 描述 |
| ----------- | ---- | --------------------------- | -------- |
| guild_id | 是 | string | 频道 ID |
| role_id | 是 | string | 身份组 ID |
| start_index | 否 | string | 上一次回包中 next, 如果是第一次请求填 0,默认为 0 |
| limit | 否 | number | 分页大小,1-400,默认是 1 |

## 返回说明

| 字段名 | 类型 | 描述 |
| -------- | ------- | ------------ |
| data | [Member](#Member) | 一组用户信息对象 |
| next | string | 下一次请求的分页标识 |


## Member

| 字段名 | 类型 | 描述 |
| --------- | ------------- | -------------------------------------------------------------------------------------------- |
| user | [User](#user) | 用户的频道基础信息,只有成员相关接口中会填充此信息 |
| nick | string | 用户在频道内的昵称 |
| joined_at | string | 用户加入频道的时间,是个 `ISO8601 timestamp` 字符串,例:"2021-11-23T15:16:48+08:00" |

## 返回示例

`data`:

```json
{
"data": [
{
"user": {
"id": "用户 ID",
"username": "用户名",
"avatar": "用户头像地址",
"bot": false
},
"nick": "",
"joined_at": "2021-11-23T15:16:48+08:00"
}
]
"next": "0"
}
```
6 changes: 5 additions & 1 deletion docs/develop/pythonsdk/changelog/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# PythonSDK更新日志

## 2023-05-02

* feat: pythonsdk 添加获取频道身份组的成员列表的接口 ([582c2b1](https://github.com/tencent-connect/botpy/pull/135/commits/582c2b185a3264c0b6dcbfb91128f127559dff7d))

## 2022-06-17

* feat: 完善ws事件中Message数据的构建 ([9564cb2](https://github.com/tencent-connect/botpy/pull/103/commits/9564cb2858833fb8de442123226fe7a46f743fe6))
Expand Down Expand Up @@ -69,4 +73,4 @@
## 2021-12-25

* fix: 修改import规范 ([37099b3](https://github.com/tencent-connect/botpy/commit/37099b37fb0047bae2136f1944c6f12ae860ba68))
* [init]初始化框架代码 ([4413bd5](https://github.com/tencent-connect/botpy/commit/4413bd5152da1e51fba0551f86d4560c55afecf8))
* [init]初始化框架代码 ([4413bd5](https://github.com/tencent-connect/botpy/commit/4413bd5152da1e51fba0551f86d4560c55afecf8))