diff --git a/coolq/api.go b/coolq/api.go index 486c069..258d923 100644 --- a/coolq/api.go +++ b/coolq/api.go @@ -655,6 +655,18 @@ func (bot *CQBot) CQGetVersionInfo() MSG { "runtime_version": runtime.Version(), "runtime_os": runtime.GOOS, "version": Version, + "protocol": func() int { + switch client.SystemDeviceInfo.Protocol { + case client.AndroidPad: + return 0 + case client.AndroidPhone: + return 1 + case client.AndroidWatch: + return 2 + default: + return -1 + } + }(), }) } diff --git a/coolq/event.go b/coolq/event.go index 63b1f07..d03a8a4 100644 --- a/coolq/event.go +++ b/coolq/event.go @@ -216,11 +216,11 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven "post_type": "notice", "group_id": group.Code, "notice_type": "notify", - "notify_type": "poke", + "sub_type": "poke", "self_id": c.Uin, "user_id": notify.Sender, "sender_id": notify.Sender, - "receiver_id": notify.Receiver, + "target_id": notify.Receiver, "time": time.Now().Unix(), }) case *client.GroupRedBagLuckyKingNotifyEvent: @@ -228,15 +228,15 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven luckyKing := group.FindMember(notify.LuckyKing) log.Infof("群 %v 内 %v 的红包被抢完, %v 是运气王", formatGroupName(group), formatMemberName(sender), formatMemberName(luckyKing)) bot.dispatchEventMessage(MSG{ - "post_type": "notice", - "group_id": group.Code, - "notice_type": "notify", - "notify_type": "lucky_king", - "self_id": c.Uin, - "user_id": notify.Sender, - "sender_id": notify.Sender, - "lucky_king_id": notify.LuckyKing, - "time": time.Now().Unix(), + "post_type": "notice", + "group_id": group.Code, + "notice_type": "notify", + "sub_type": "lucky_king", + "self_id": c.Uin, + "user_id": notify.Sender, + "sender_id": notify.Sender, + "target_id": notify.LuckyKing, + "time": time.Now().Unix(), }) case *client.MemberHonorChangedNotifyEvent: log.Info(notify.Content()) @@ -244,7 +244,7 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven "post_type": "notice", "group_id": group.Code, "notice_type": "notify", - "notify_type": "honor", + "sub_type": "honor", "self_id": c.Uin, "user_id": notify.Uin, "time": time.Now().Unix(), diff --git a/docs/cqhttp.md b/docs/cqhttp.md index 3ef1681..7ce7a33 100644 --- a/docs/cqhttp.md +++ b/docs/cqhttp.md @@ -386,9 +386,9 @@ Type: `cardimage` | ------------- | ------ | -------------- | -------------- | | `post_type` | string | `notice` | 上报类型 | | `notice_type` | string | `notify` | 消息类型 | -| `notify_type` | string | `poke` | 提示类型 | +| `sub_type` | string | `poke` | 提示类型 | | `user_id` | int64 | | 发送者id | -| `receiver_id` | int64 | | 被戳者id | +| `target_id` | int64 | | 被戳者id | #### 群红包运气王提示 @@ -400,6 +400,20 @@ Type: `cardimage` | ------------- | ------ | -------------- | -------------- | | `post_type` | string | `notice` | 上报类型 | | `notice_type` | string | `notify` | 消息类型 | -| `notify_type` | string | `lucky_king` | 提示类型 | +| `sub_type` | string | `lucky_king` | 提示类型 | | `user_id` | int64 | | 红包发送者id | -| `lucky_king_id` | int64 | | 运气王id | +| `target_id` | int64 | | 运气王id | + +#### 群成员荣誉变更提示 + +> 注意:此事件无法在平板和手表协议上触发 + +**上报数据** + +| 字段 | 类型 | 可能的值 | 说明 | +| ------------- | ------ | -------------- | -------------- | +| `post_type` | string | `notice` | 上报类型 | +| `notice_type` | string | `notify` | 消息类型 | +| `sub_type` | string | `honor` | 提示类型 | +| `user_id` | int64 | | 成员id | +| `honor_type` | int64 | `talkative:龙王` `performer:群聊之火` `emotion:快乐源泉` | 荣誉类型 | \ No newline at end of file