mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
116 lines
2.9 KiB
Markdown
116 lines
2.9 KiB
Markdown
---
|
||
title: 通用数据
|
||
icon: database
|
||
---
|
||
|
||
## 所有上报
|
||
|
||
所有上报事件都包含以下字段:
|
||
|
||
| 字段 | 类型 | 说明 |
|
||
| --------- | ------ | -------- |
|
||
| time | int64 | 时间戳 |
|
||
| self_id | int64 | 机器人QQ |
|
||
| post_type | string | 上报类型 |
|
||
|
||
::: tip 提示
|
||
`post_type` 为 `message` 或 `message_sent` 时,数据是一致的。
|
||
区别在于 `message` 是收到的消息,`message_sent` 是发送的消息。
|
||
|
||
默认情况下,Shamrock 只会上报 `message` 类型的消息。
|
||
:::
|
||
|
||
## 事件类型
|
||
|
||
### PostType
|
||
|
||
| 类型 | 说明 |
|
||
| ---------------- | -------- |
|
||
| message | 收到消息 |
|
||
| message_sent | 发送消息 |
|
||
| notice | 通知 |
|
||
| request | 请求 |
|
||
|
||
### MessageType
|
||
|
||
| 类型 | 说明 |
|
||
| ------- | -------- |
|
||
| private | 私聊消息 |
|
||
| group | 群消息 |
|
||
|
||
### MessageSubType
|
||
|
||
| 类型 | 说明 |
|
||
| ------------- | ---------------- |
|
||
| friend | 好友消息 |
|
||
| normal | 群消息 |
|
||
| ~~anonymous~~ | 匿名消息 |
|
||
| group | 群临时消息 |
|
||
| group_self | 群消息(自身操作) |
|
||
| notice | 系统提示 |
|
||
|
||
### NoticeType
|
||
|
||
| 类型 | 说明 |
|
||
| -------------- | ---------------- |
|
||
| group_upload | 群文件上传 |
|
||
| group_admin | 群管理员变动 |
|
||
| group_decrease | 群成员减少 |
|
||
| group_increase | 群成员增加 |
|
||
| group_ban | 群禁言 |
|
||
| group_recall | 群消息撤回 |
|
||
| group_card | 群成员名片变动 |
|
||
| friend_add | 好友添加 |
|
||
| friend_recall | 好友撤回 |
|
||
| offline_file | 接收到离线文件包 |
|
||
| client_status | 客户端状态 |
|
||
| essence | 精华消息 |
|
||
| notify | 系统通知 |
|
||
|
||
### NoticeNotifySubType
|
||
|
||
| 类型 | 说明 |
|
||
| ---------- | ---------- |
|
||
| honor | 群荣誉变更 |
|
||
| poke | 戳一戳 |
|
||
| lucky_king | 运气王 |
|
||
| title | 群头衔变更 |
|
||
|
||
### RequestType
|
||
|
||
| 类型 | 说明 |
|
||
| ------ | -------- |
|
||
| friend | 好友请求 |
|
||
| group | 群请求 |
|
||
|
||
## 数据结构
|
||
|
||
### MessageSender
|
||
|
||
| 字段 | 类型 | 说明 |
|
||
| -------- | ------ | ------------ |
|
||
| user_id | int64 | 发送者 QQ 号 |
|
||
| nickname | string | 发送者昵称 |
|
||
|
||
如果是群消息,还会包含以下字段:
|
||
|
||
| 字段 | 类型 | 说明 |
|
||
| ----- | ------ | ------------ |
|
||
| card | string | 发送者群名片 |
|
||
| level | string | 发送者等级 |
|
||
| role | string | 发送者角色 |
|
||
| title | string | 发送者头衔 |
|
||
|
||
### Post_Message_TempSource
|
||
|
||
| 类型 | 来源 |
|
||
|------|------|
|
||
| 0 | 群聊 |
|
||
| 1 | QQ咨询 |
|
||
| 2 | 查找 |
|
||
| 3 | QQ电影 |
|
||
| 4 | 热聊 |
|
||
| 6 | 验证消息 |
|
||
| 7 | 多人聊天 |
|
||
| 8 | 约会 |
|
||
| 9 | 通讯录 | |