# 用户使用Bot命令

# 一 收到的JSON 内容
```
{
    "sequence": 11736260019,
    "type": "50",
    "notify_type": "",
    "data": {
        "bot_id": 72053518,
        "channel_base_info": {
            "channel_id": "3611849174307799042",
            "channel_name": "默认频道",
            "channel_type": 1
        },
        "command_info": {
            "id": "1831636113196855296",
            "name": "/test",
            "options": [
                {
                    "name": "test",
                    "type": 3,
                    "value": "123123"
                }
            ],
            "type": 0
        },
        "msg_id": "1831637085605466112",
        "room_base_info": {
            "room_avatar": "",
            "room_id": "3611849174284943360",
            "room_name": "酸辣鸡杂面的房间"
        },
        "send_time": 1725531286039,
        "sender_info": {
            "avatar": "https://cdn.max-c.com/heybox/profile/avatar/heygirl_3.png",
            "avatar_decoration": {
                "src_type": "image",
                "src_url": "https://imgheybox.max-c.com/oa/2024/08/19/02e11b983bbd0fdcd5d9db03989ad713.gif"
            },
            "bot": false,
            "level": 10,
            "medals": null,
            "nickname": "酸辣鸡杂面",
**            **"roles": null,
            "room_nickname": "",
            "tag": null,
            "user_id": 43028164
        }
    },
    "timestamp": 1725531286040
}
```
# 二 非命令字段解析

## 2.1 最外层字段
| 字段名称 |类型| 作用 |使用场景|
| --- | --- |--- |--- |
|**sequence** |int64 | 序列号，用于唯一标识这个事件 |
|**type**  |int64 |消息类型 |当收到50类型的消息的时候,处理对应的命令事件|
|**data**  |object | 收到的推送的具体内容 |
|**timestamp**  |int64 | 推送产生的时间,毫秒时间戳 |

## 2.2 data 字段
| 字段名称 |类型| 描述 |使用|
| --- | --- |--- |--- |
|**bot_id**  |int| 用户使用的机器人ID |校验是否与本地机器人ID 相同|
|channel_base_info | oject| 频道的基本信息,具体查看[通用推送字段](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/5254214m0.md)中的channel_base_info ||
|**room_base_info**  | oject| 房间的基本信息,具体查看[通用推送字段](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/5254214m0.md)中的room_base_info ||
|**command_info** | oject | 用户使用的命令信息 ||
|**send_time**  |int64| 消息发送的毫秒时间戳。 |校验消息是否延迟到达|
|**sender_info**  | oject| 发送者的信息,具体查看[通用推送字段](https://s.apifox.cn/43256fe4-9a8c-4f22-949a-74a3f8b431f5/5254214m0.md)中的sender_info||


# 三 命令字段
## 3.1 command_info 字段
| 字段名称 |类型| 描述 |
| --- | --- |--- |
|**id**|string|使用的命令id|
|**name**  |string|  使用的命令名称 |
|**options**  |数组类型| 使用的命令参数列表|
|**type**  | int| 命令类型 目前只有默认类型|

## 3.2 options字段 字段
| 字段名称 |类型| 描述 |使用场景|
| --- | --- |--- |--- |
|**name**|string|使用的参数名称|
|**type**  |int| 使用的参数类型 ||
|**value**  |string| 使用的参数值,这是string||

## 3.3 参数类型 **type**
这些类型对应的值都是String 需要手动转换
| 字段名称 | 类型 |
| --- | --- |
|3|String 类型|
|4  | Number  类型 ||
|5  | Boolean  类型||
|6|User 用户类型|
|7  | Channel 频道类型 ||
|8  | Role 房间角色类型||
|9  | 选择项类型的选择结果||
|10  | Integer类型||





