用户相关事件列表

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

用户加入语音频道

extra 字段说明:

字段 类型 说明
type string 消息的类型,本处为 joined_channel
body Map
» user_id string 用户 id
» channel_id string 加入的频道 id
» joined_at int 加入时间

示例:

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 255,
  6. "target_id": "6016389910000000",
  7. "author_id": "1",
  8. "content": "[系统消息]",
  9. "extra": {
  10. "type": "joined_channel",
  11. "body": {
  12. "user_id": "2418200000",
  13. "channel_id": "9219038000000",
  14. "joined_at": 1612790368279
  15. }
  16. },
  17. "msg_id": "30a7f591-xxxx-322f35105524",
  18. "msg_timestamp": 1612790368279,
  19. "nonce": "",
  20. "verify_token": "xxx"
  21. },
  22. "sn": 42
  23. }

用户退出语音频道

extra 字段说明:

字段 类型 说明
type string 消息的类型,本处为 exited_channel
body Map
» user_id string 用户 id
» channel_id string 加入的频道 id
» exited_at int 退出时间

示例:

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "GROUP",
  5. "type": 255,
  6. "target_id": "6016389910000000",
  7. "author_id": "1",
  8. "content": "[系统消息]",
  9. "extra": {
  10. "type": "exited_channel",
  11. "body": {
  12. "user_id": "2418200000",
  13. "channel_id": "9219038000000",
  14. "exited_at": 1612790411267
  15. }
  16. },
  17. "msg_id": "386e533c-xxxxx-7ee2bded364e",
  18. "msg_timestamp": 1612790411274,
  19. "nonce": "",
  20. "verify_token": "xxx"
  21. },
  22. "sn": 43
  23. }

用户信息更新

该事件与服务器无关, 遵循以下条件

  1. 仅当用户的 用户名头像 变更时;
  2. 仅通知与该用户存在关联的用户或 Bot: a. 存在聊天会话 b. 双方好友关系

extra 字段说明:

字段 类型 说明
type string 消息的类型,本处为 user_updated
body Map
» user_id string 用户 id
» username string 用户名
» avatar string 头像图片地址

示例:

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "PERSON",
  5. "type": 255,
  6. "target_id": "2862900000",
  7. "author_id": "1",
  8. "content": "[系统消息]",
  9. "extra": {
  10. "type": "user_updated",
  11. "body": {
  12. "user_id": "2418200000",
  13. "username": "ThisIsANewUsername",
  14. "avatar": "https://img.kaiheila.cn/avatars/2020-02/xxxx.jpg/icon"
  15. }
  16. },
  17. "msg_id": "02106a94-xxxx-d60f660485dd",
  18. "msg_timestamp": 1614055075487,
  19. "nonce": "",
  20. "verify_token": "xxxx"
  21. },
  22. "sn": 199
  23. }

#

自己新加入服务器

当自己被邀请或主动加入新的服务器时, 产生该事件

extra 字段说明:

字段 类型 说明
type string 消息的类型,本处为 self_joined_guild
body Map
» guild_id string 服务器 id

示例:

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "PERSON",
  5. "type": 255,
  6. "target_id": "2862900000",
  7. "author_id": "1",
  8. "content": "[系统消息]",
  9. "extra": {
  10. "type": "self_joined_guild",
  11. "body": {
  12. "guild_id": "xxx"
  13. }
  14. },
  15. "msg_id": "238063ab-xxxx-cd90c3cfb92f",
  16. "msg_timestamp": 1614140348008,
  17. "nonce": "",
  18. "verify_token": "xxx"
  19. },
  20. "sn": 214
  21. }

自己退出服务器

当自己被踢出服务器或被拉黑或主动退出服务器时, 产生该事件

extra 字段说明:

字段 类型 说明
type string 消息的类型,本处为 self_exited_guild
body Map
» guild_id string 服务器 id

示例:

  1. {
  2. "s": 0,
  3. "d": {
  4. "channel_type": "PERSON",
  5. "type": 255,
  6. "target_id": "2862900000",
  7. "author_id": "1",
  8. "content": "[系统消息]",
  9. "extra": {
  10. "type": "self_exited_guild",
  11. "body": {
  12. "guild_id": "xxx"
  13. }
  14. },
  15. "msg_id": "xxxx",
  16. "msg_timestamp": 1614140348008,
  17. "nonce": "",
  18. "verify_token": "xxx"
  19. },
  20. "sn": 215
  21. }

Card 消息中的 Button 点击事件

extra 字段说明:

字段 类型 说明
type string 消息的类型,本处为 message_btn_click
body Map
» msg_id string 用户点击的消息 id
» user_id string 点击的用户
» value string return-val 的值
» target_id string 消息发送的目标 id,频道消息为频道
» user_info Map 用户信息,同 User Object

示例:

  1. {
  2. "s": 0,
  3. "sn": 1,
  4. "d": {
  5. "type": 255,
  6. "channel_type": "PERSON",
  7. "target_id": "xxxx",
  8. "author_id": "xxxx",
  9. "content": "xxxx",
  10. "msg_id": "xxxx",
  11. "msg_timestamp": 1611559482954,
  12. "nonce": "",
  13. "extra": {
  14. "type": "message_btn_click",
  15. "body": {
  16. "value": "123",
  17. "msg_id": "xxx",
  18. "user_id": "xxx",
  19. "target_id": ""
  20. }
  21. }
  22. }
  23. }