消息相关事件列表

事件格式说明:请查看 [事件结构/格式说明]

文字消息

extra 字段说明

字段 类型 说明
type int 同上面 type
guild_id string 服务器 id
channel_name string 频道名
mention Array 提及到的用户 id 的列表
mention_all boolean 是否 mention 所有用户
mention_roles Array mention 用户角色的数组
mention_here boolean 是否 mention 在线用户
author Map 用户信息, 见对象-用户 User

文字消息示例

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 1,
  6. "target_id": "xxxxxx",
  7. "author_id": "xxxxx",
  8. "content": "dddd",
  9. "msg_id": "67637d4c-xxxx-xxxx-xxxx-xxxxx",
  10. "msg_timestamp": 1607674740160,
  11. "nonce": "",
  12. "extra": {
  13. "type": 1,
  14. "guild_id": "xxxxx",
  15. "channel_name": "文字频道",
  16. "mention": [],
  17. "mention_all": false,
  18. "mention_roles": [],
  19. "mention_here": false,
  20. "code": "",
  21. "author": {
  22. "identify_num": "xxxxx",
  23. "avatar": "https://img.kaiheila.cn/avatars/2020-11/r0j9.jpg/icon",
  24. "username": "xxxxx",
  25. "id": "xxxxx",
  26. "nickname": "xxxxx",
  27. "roles": []
  28. }
  29. }
  30. },
  31. "sn": 2199
  32. }

图片消息

extra 字段说明

字段 类型 说明
type int 同上面 type
code string
guild_id string 服务器 id
attachments Map 附件
author Map 用户信息, 见对象-用户 User

图片消息示例

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 2,
  6. "target_id": "xxxxx",
  7. "author_id": "xxxxx",
  8. "content": "https://img.kaiheila.cn/assets/2020-12/asasd.jpg",
  9. "msg_id": "67637d4c-xxxx-xxxx-xxxx-xxxxx",
  10. "msg_timestamp": 1607678646991,
  11. "nonce": "",
  12. "extra": {
  13. "type": 2,
  14. "code": "",
  15. "guild_id": "xxxxx",
  16. "attachments": {
  17. "type": "image",
  18. "name": "xxxx.jpg",
  19. "url": "https://img.kaiheila.cn/assets/2020-12/IHT5x5oSLA07o03m.jpg"
  20. },
  21. "author": {
  22. "identify_num": "xxxxx",
  23. "avatar": "https://img.kaiheila.cn/avatars/2020-11/r26z1e70f20j9.jpg/icon",
  24. "username": "xxxxx",
  25. "id": "xxxxx",
  26. "nickname": "xxxxx",
  27. "roles": []
  28. }
  29. }
  30. },
  31. "sn": 2499
  32. }

视频消息

extra 字段说明

字段 类型 说明
type int 同上面 type
code string
guild_id string 服务器 id
attachments Map 附件
author Map 用户信息, 见对象-用户 User

视频消息示例

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 3,
  6. "target_id": "xxxxx",
  7. "author_id": "xxxxx",
  8. "content": "https://img.kaiheila.cn/attachments/2020-12/11/asd.mp4",
  9. "msg_id": "67637d4c-xxxx-xxxx-xxxx-xxxxx",
  10. "msg_timestamp": 1607679613599,
  11. "nonce": "",
  12. "extra": {
  13. "type": 3,
  14. "guild_id": "xxxx",
  15. "code": "",
  16. "attachments": {
  17. "type": "video",
  18. "url": "https://img.kaiheila.cn/attachments/2020-12/11/asd.mp4",
  19. "name": "002iQMhagx07Fx0S41200323o0E010.mp4",
  20. "file_type": "video/mp4",
  21. "size": 722882,
  22. "duration": 15.673,
  23. "width": 360,
  24. "height": 635
  25. },
  26. "author": {
  27. "identify_num": "xxxxx",
  28. "avatar": "https://img.kaiheila.cn/avatars/2020-11/r20f20j9.jpg/icon",
  29. "username": "xxxxx",
  30. "id": "xxxxx",
  31. "nickname": "xxxxx",
  32. "roles": []
  33. }
  34. }
  35. },
  36. "sn": 2582
  37. }

文件消息

extra 字段说明

字段 类型 说明
type int 同上面 type
code string
guild_id string 服务器 id
attachments Map 附件
author Map 用户信息, 见对象-用户 User

文件消息示例

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 4,
  6. "target_id": "xxxx",
  7. "author_id": "xxxx",
  8. "content": "https://img.kaiheila.cn/attachments/2020-12/11/asd.txt",
  9. "msg_id": "67637d4c-xxxx-xxxx-xxxx-xxxxx",
  10. "msg_timestamp": 1607679683305,
  11. "nonce": "",
  12. "extra": {
  13. "type": 4,
  14. "guild_id": "xxxx",
  15. "code": "",
  16. "attachments": {
  17. "type": "file",
  18. "url": "https://img.kaiheila.cn/attachments/2020-12/11/asd.txt",
  19. "name": "voice-message.txt",
  20. "file_type": "text/plain",
  21. "size": 7320
  22. },
  23. "author": {
  24. "identify_num": "xxxx",
  25. "avatar": "https://img.kaiheila.cn/avatars/2020-11/asd.jpg/icon",
  26. "username": "xxxx",
  27. "id": "xxxx",
  28. "nickname": "xxxx",
  29. "roles": []
  30. }
  31. }
  32. },
  33. "sn": 2587
  34. }

KMarkdown 消息

extra 字段说明

字段 类型 说明
type int 同上面 type
guild_id string 服务器 id
channel_name string 频道名
mention Array 提及到的用户 id 的列表
mention_all boolean 是否 mention 所有用户
mention_roles Array mention 用户角色的数组
mention_here boolean 是否 mention 在线用户
nav_channels Array
code string
author Map 用户信息, 见对象-用户 User
kmarkdown Map

KMarkdown 消息示例

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 9,
  6. "target_id": "48818200000000000",
  7. "author_id": "2418200000",
  8. "content": "*Hello World*",
  9. "extra": {
  10. "type": 9,
  11. "guild_id": "6016389914000000",
  12. "channel_name": "123123",
  13. "mention": [],
  14. "mention_all": false,
  15. "mention_roles": [],
  16. "mention_here": false,
  17. "nav_channels": [],
  18. "code": "",
  19. "author": {
  20. "id": "2418200000",
  21. "username": "tz-un",
  22. "identify_num": "5618",
  23. "online": false,
  24. "os": "Websocket",
  25. "status": 1,
  26. "avatar": "https://img.kaiheila.cn/avatars/2020-02/xxxx.jpg/icon",
  27. "tag_info": {
  28. "color": "#6666CC",
  29. "text": "开黑啦"
  30. },
  31. "nickname": "12316993",
  32. "roles": [111, 112]
  33. },
  34. "kmarkdown": {
  35. "raw_content": "Hello World",
  36. "mention_part": [],
  37. "mention_role_part": []
  38. }
  39. },
  40. "msg_id": "789c0b23-xxxx-f7ae1a946f11",
  41. "msg_timestamp": 1613996877757,
  42. "nonce": "",
  43. "verify_token": "xxx"
  44. },
  45. "sn": 181
  46. }

Card 消息

extra 字段说明

字段 类型 说明
type int 同上面 type
guild_id string 服务器 id
channel_name string 频道名
mention Array 提及到的用户 id 的列表
mention_all boolean 是否 mention 所有用户
mention_roles Array mention 用户角色的数组
mention_here boolean 是否 mention 在线用户
nav_channels Array
code string
author Map 用户信息, 见对象-用户 User

Card 消息示例

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 10,
  6. "target_id": "48818200000000000",
  7. "author_id": "2418200000",
  8. // 卡片内容省略
  9. "content": "",
  10. "extra": {
  11. "type": 10,
  12. "guild_id": "6016389910000000",
  13. "channel_name": "文字频道",
  14. "mention": [],
  15. "mention_all": false,
  16. "mention_roles": [],
  17. "mention_here": false,
  18. "nav_channels": [],
  19. "code": "",
  20. "author": {
  21. "id": "2418200000",
  22. "username": "tz-un",
  23. "identify_num": "5618",
  24. "online": false,
  25. "os": "Websocket",
  26. "status": 1,
  27. "avatar": "https://img.kaiheila.cn/avatars/2020-02/xxxx.jpg/icon",
  28. "tag_info": {
  29. "color": "#6666CC",
  30. "text": "开黑啦"
  31. },
  32. "nickname": "12316993",
  33. "roles": [111, 112]
  34. }
  35. },
  36. "msg_id": "553f1f78-xxxxx-39c65d9c5584",
  37. "msg_timestamp": 1613996743849,
  38. "nonce": "",
  39. "verify_token": "xxxxx"
  40. },
  41. "sn": 180
  42. }