Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
go-cqhttp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
go-cqhttp
Commits
6f251e3d
Commit
6f251e3d
authored
Sep 13, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo.
parent
6101c4d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
16 deletions
+42
-16
coolq/api.go
coolq/api.go
+12
-0
coolq/event.go
coolq/event.go
+12
-12
docs/cqhttp.md
docs/cqhttp.md
+18
-4
No files found.
coolq/api.go
View file @
6f251e3d
...
@@ -655,6 +655,18 @@ func (bot *CQBot) CQGetVersionInfo() MSG {
...
@@ -655,6 +655,18 @@ func (bot *CQBot) CQGetVersionInfo() MSG {
"runtime_version"
:
runtime
.
Version
(),
"runtime_version"
:
runtime
.
Version
(),
"runtime_os"
:
runtime
.
GOOS
,
"runtime_os"
:
runtime
.
GOOS
,
"version"
:
Version
,
"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
}
}(),
})
})
}
}
...
...
coolq/event.go
View file @
6f251e3d
...
@@ -216,11 +216,11 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven
...
@@ -216,11 +216,11 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven
"post_type"
:
"notice"
,
"post_type"
:
"notice"
,
"group_id"
:
group
.
Code
,
"group_id"
:
group
.
Code
,
"notice_type"
:
"notify"
,
"notice_type"
:
"notify"
,
"
notify_type"
:
"poke"
,
"
sub_type"
:
"poke"
,
"self_id"
:
c
.
Uin
,
"self_id"
:
c
.
Uin
,
"user_id"
:
notify
.
Sender
,
"user_id"
:
notify
.
Sender
,
"sender_id"
:
notify
.
Sender
,
"sender_id"
:
notify
.
Sender
,
"
receiver_id"
:
notify
.
Receiver
,
"
target_id"
:
notify
.
Receiver
,
"time"
:
time
.
Now
()
.
Unix
(),
"time"
:
time
.
Now
()
.
Unix
(),
})
})
case
*
client
.
GroupRedBagLuckyKingNotifyEvent
:
case
*
client
.
GroupRedBagLuckyKingNotifyEvent
:
...
@@ -228,15 +228,15 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven
...
@@ -228,15 +228,15 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven
luckyKing
:=
group
.
FindMember
(
notify
.
LuckyKing
)
luckyKing
:=
group
.
FindMember
(
notify
.
LuckyKing
)
log
.
Infof
(
"群 %v 内 %v 的红包被抢完, %v 是运气王"
,
formatGroupName
(
group
),
formatMemberName
(
sender
),
formatMemberName
(
luckyKing
))
log
.
Infof
(
"群 %v 内 %v 的红包被抢完, %v 是运气王"
,
formatGroupName
(
group
),
formatMemberName
(
sender
),
formatMemberName
(
luckyKing
))
bot
.
dispatchEventMessage
(
MSG
{
bot
.
dispatchEventMessage
(
MSG
{
"post_type"
:
"notice"
,
"post_type"
:
"notice"
,
"group_id"
:
group
.
Code
,
"group_id"
:
group
.
Code
,
"notice_type"
:
"notify"
,
"notice_type"
:
"notify"
,
"
notify_type"
:
"lucky_king"
,
"
sub_type"
:
"lucky_king"
,
"self_id"
:
c
.
Uin
,
"self_id"
:
c
.
Uin
,
"user_id"
:
notify
.
Sender
,
"user_id"
:
notify
.
Sender
,
"sender_id"
:
notify
.
Sender
,
"sender_id"
:
notify
.
Sender
,
"
lucky_king_id"
:
notify
.
LuckyKing
,
"
target_id"
:
notify
.
LuckyKing
,
"time"
:
time
.
Now
()
.
Unix
(),
"time"
:
time
.
Now
()
.
Unix
(),
})
})
case
*
client
.
MemberHonorChangedNotifyEvent
:
case
*
client
.
MemberHonorChangedNotifyEvent
:
log
.
Info
(
notify
.
Content
())
log
.
Info
(
notify
.
Content
())
...
@@ -244,7 +244,7 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven
...
@@ -244,7 +244,7 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven
"post_type"
:
"notice"
,
"post_type"
:
"notice"
,
"group_id"
:
group
.
Code
,
"group_id"
:
group
.
Code
,
"notice_type"
:
"notify"
,
"notice_type"
:
"notify"
,
"
notify_type"
:
"honor"
,
"
sub_type"
:
"honor"
,
"self_id"
:
c
.
Uin
,
"self_id"
:
c
.
Uin
,
"user_id"
:
notify
.
Uin
,
"user_id"
:
notify
.
Uin
,
"time"
:
time
.
Now
()
.
Unix
(),
"time"
:
time
.
Now
()
.
Unix
(),
...
...
docs/cqhttp.md
View file @
6f251e3d
...
@@ -386,9 +386,9 @@ Type: `cardimage`
...
@@ -386,9 +386,9 @@ Type: `cardimage`
| ------------- | ------ | -------------- | -------------- |
| ------------- | ------ | -------------- | -------------- |
|
`post_type`
| string |
`notice`
| 上报类型 |
|
`post_type`
| string |
`notice`
| 上报类型 |
|
`notice_type`
| string |
`notify`
| 消息类型 |
|
`notice_type`
| string |
`notify`
| 消息类型 |
|
`
notify
_type`
| string |
`poke`
| 提示类型 |
|
`
sub
_type`
| string |
`poke`
| 提示类型 |
|
`user_id`
| int64 | | 发送者id |
|
`user_id`
| int64 | | 发送者id |
|
`
receiver
_id`
| int64 | | 被戳者id |
|
`
target
_id`
| int64 | | 被戳者id |
#### 群红包运气王提示
#### 群红包运气王提示
...
@@ -400,6 +400,20 @@ Type: `cardimage`
...
@@ -400,6 +400,20 @@ Type: `cardimage`
| ------------- | ------ | -------------- | -------------- |
| ------------- | ------ | -------------- | -------------- |
|
`post_type`
| string |
`notice`
| 上报类型 |
|
`post_type`
| string |
`notice`
| 上报类型 |
|
`notice_type`
| string |
`notify`
| 消息类型 |
|
`notice_type`
| string |
`notify`
| 消息类型 |
|
`
notify
_type`
| string |
`lucky_king`
| 提示类型 |
|
`
sub
_type`
| string |
`lucky_king`
| 提示类型 |
|
`user_id`
| int64 | | 红包发送者id |
|
`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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment