# 房间相关接口文档

## 修改房间内昵称
### 接口地址
[修改房间内昵称](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/226373089e0.md)
### 权限需求
    修改房间内的昵称需要机器人拥有**管理员**或者**管理昵称**权限,详情查看[权限接口描述](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/4781009m0.md)
### POST请求的Body请求参数
```
{
    "nickname": "测试昵称",
    "room_id": "3587810143523774464",
    "to_user_id": 8828375
}
```

| 参数名 | 类型 | 必须 | 说明 |
| --- | --- | --- | --- |
| nickname | string | true | 用于设定或清空修改目标在房间内的昵称。若不传入该参数值，则会清空昵称。此昵称长度最长为 20 个字符。 |
| room_id | string | true | 用于指定特定的房间 ID，以确定在哪个房间内进行昵称修改操作。 |
| to_user_id | int64 | true | 代表修改目标的用户 ID。若该 ID 与当前操作者自身 ID 相同，则表示修改自己在房间内的昵称。 |

### 返回结果
修改成功
```
{
    "msg": "",
    "result": {},
    "status": "ok"
}
```
修改失败

```
{
    "msg": "权限不足",
    "result": {},
    "status": "failed"
}
```

## 获取加入的房间列表
### 接口地址
[获取加入的房间列表](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/226373523e0.md)
### 权限需求
无
### Get请求的Query请求参数
| 参数名 | 类型 | 说明 |
| ---- | ---- | ---- |
| offset | int | 表示跳过的房间数量，用于分页查询时确定起始位置 |
| limit | int | 限制返回结果的数量，其最大值为 50，用于控制数据获取量 |

### 返回结果
获取成功
```
{
    "msg": "",
    "result": {
        "rooms": [
            {
                "room_id": "372850461859040xxxx",
                "room_name": "测试2",
                "room_avatar": "https://imgheybox.max-c.com/dev/bbs/2024/12/05/e380b1a5f190784c252ec3696fa33fd3.png",
                "create_by": 100001,
                "room_pic": "",
                "is_public": 0,
                "public_id": "",
                "is_hot": 0,
                "join_time": 1733388149129
            }
        ],
        "total": 84,
        "offset": 0,
        "limit": 50
    },
    "status": "ok"
}
```
| 参数名 | 类型 | 说明 |
| ---- | ---- | ---- |
| room_id | string | 房间的唯一ID |
| room_name | string | 房间的名称 |
| room_avatar | string | 房间左上角以及目录中的小尺寸图片路径 |
| room_pic | string | 房间左上角的大尺寸图片路径 |
| create_by | int64 | 创建该房间的用户ID |
| is_public | int | 表示房间的公开状态，取值为 1 时表示房间公开，其他用户可使用public_id自由访问；取值为 0 时表示房间非公开 |
| public_id | string | 当房间公开时生成的特定 ID，可供其他用户凭借此 ID 加入该房间 |
| is_hot | int | 表明房间是否为热门房间，取值为 1 时为热门房间，会在首页热门列表中展示；取值为 0 时则不是热门房间 |
| join_time | int64 | 用户加入房间的时间，以毫秒为单位的时间戳形式 | 

## 退出房间
### 接口地址
[退出房间](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/226373638e0.md)
### 权限需求
    无
### POST请求的Body请求参数
```
{
    "room_id": "3587810143523774464"
}
```

| 参数名 | 类型 | 必须 | 说明 |
| --- | --- | --- | --- |
| room_id | string | true | 用于指定特定的房间 ID，以确定在哪个房间内进行退出操作。 |


### 返回结果
```
{
    "msg": "",
    "result": {},
    "status": "ok"
}
```
## 房间踢人
### 接口地址
[房间踢人](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/226373709e0.md)
### 权限需求
    房间踢人 需要机器人拥有**管理员**或者**将某人踢出房间**权限,详情查看[权限接口描述](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/4781009m0.md)
### POST请求的Body请求参数
```
{
    "room_id": "3587810143523774464",
    "to_user_id": 8828375
}
```

| 参数名 | 类型 | 必须 | 说明 |
| --- | --- | --- | --- |
| room_id | string | true | 用于指定特定的房间 ID，以确定在哪个房间内进行踢人操作。 |
| to_user_id | int64 | true | 代表踢人目标的用户 ID。 |

### 返回结果
成功
```
{
    "msg": "",
    "result": {},
    "status": "ok"
}
```
失败

```
{
    "msg": "权限不足",
    "result": {},
    "status": "failed"
}
```
## 语音频道之间移动用户
### 接口地址
[修改房间内昵称](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/318260744e0.md)
### 权限需求
    语音频道之间移动用户 需要机器人拥有**管理员**或者**移动成员**权限,详情查看[权限接口描述](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/4781009m0.md)
### POST请求的Body请求参数
```
{
    "room_id": "3884071942269132800", 
    "origin_channel_id": "3884071942639140870", 
    "to_user_ids": [
        8836257
    ], 
    "channel_id": "3884071973717917696"
}
```

| 参数名 | 类型 | 必须 | 说明 |
| --- | --- | --- | --- |
| channel_id | string | true | 目标频道ID。 |
| origin_channel_id | string | true | 用户当前所在频道ID。 |
| room_id | string | true | 用于指定特定的房间 ID，以确定在哪个房间内进行昵称修改操作。 |
| to_user_id | \[\]int64 | true | 移动目标的用户 ID。|

### 返回结果
修改成功
```
{
    "msg": "",
    "result": {},
    "status": "ok"
}
```
修改失败

```
{
    "msg": "权限不足",
    "result": {},
    "status": "failed"
}
```
## 踢出语音频道中的用户
### 接口地址
[修改房间内昵称](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/318266039e0.md)
### 权限需求
    踢出语音频道中的用户 需要机器人拥有**管理员**或者**踢出频道**权限,详情查看[权限接口描述](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/4781009m0.md)
### POST请求的Body请求参数
```
{
    "room_id": "3884071942269132800", 
    "to_user_id": 8836257, 
    "channel_id": "3884071973717917696"
}
```

| 参数名 | 类型 | 必须 | 说明 |
| --- | --- | --- | --- |
| channel_id | string | true | 用户所在频道ID。 |
| room_id | string | true | 用于指定特定的房间 ID。 |
| to_user_id | int64 | true | 代表踢出目标的用户 ID。 |

### 返回结果
修改成功
```
{
    "msg": "",
    "result": {},
    "status": "ok"
}
```
修改失败

```
{
    "msg": "权限不足",
    "result": {},
    "status": "failed"
}
```

