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
58a3f811
Commit
58a3f811
authored
Aug 01, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new event: friend_recall.
parent
64cb539c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
coolq/bot.go
coolq/bot.go
+1
-0
coolq/event.go
coolq/event.go
+15
-1
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-0
No files found.
coolq/bot.go
View file @
58a3f811
...
...
@@ -51,6 +51,7 @@ func NewQQBot(cli *client.QQClient, conf *global.JsonConfig) *CQBot {
bot
.
Client
.
OnTempMessage
(
bot
.
tempMessageEvent
)
bot
.
Client
.
OnGroupMuted
(
bot
.
groupMutedEvent
)
bot
.
Client
.
OnGroupMessageRecalled
(
bot
.
groupRecallEvent
)
bot
.
Client
.
OnFriendMessageRecalled
(
bot
.
friendRecallEvent
)
bot
.
Client
.
OnJoinGroup
(
bot
.
joinGroupEvent
)
bot
.
Client
.
OnLeaveGroup
(
bot
.
leaveGroupEvent
)
bot
.
Client
.
OnGroupMemberJoined
(
bot
.
memberJoinEvent
)
...
...
coolq/event.go
View file @
58a3f811
...
...
@@ -21,7 +21,7 @@ func (bot *CQBot) privateMessageEvent(c *client.QQClient, m *message.PrivateMess
"post_type"
:
"message"
,
"message_type"
:
"private"
,
"sub_type"
:
"friend"
,
"message_id"
:
m
.
Id
,
"message_id"
:
ToGlobalId
(
m
.
Sender
.
Uin
,
m
.
Id
)
,
"user_id"
:
m
.
Sender
.
Uin
,
"message"
:
ToStringMessage
(
m
.
Elements
,
0
,
false
),
"raw_message"
:
cqm
,
...
...
@@ -184,6 +184,20 @@ func (bot *CQBot) groupRecallEvent(c *client.QQClient, e *client.GroupMessageRec
})
}
func
(
bot
*
CQBot
)
friendRecallEvent
(
c
*
client
.
QQClient
,
e
*
client
.
FriendMessageRecalledEvent
)
{
f
:=
c
.
FindFriend
(
e
.
FriendUin
)
gid
:=
ToGlobalId
(
e
.
FriendUin
,
e
.
MessageId
)
log
.
Infof
(
"好友 %v(%v) 撤回了消息: %v"
,
f
.
Nickname
,
f
.
Uin
,
gid
)
bot
.
dispatchEventMessage
(
MSG
{
"post_type"
:
"notice"
,
"notice_type"
:
"friend_recall"
,
"self_id"
:
c
.
Uin
,
"user_id"
:
f
.
Uin
,
"time"
:
e
.
Time
,
"message_id"
:
gid
,
})
}
func
(
bot
*
CQBot
)
joinGroupEvent
(
c
*
client
.
QQClient
,
group
*
client
.
GroupInfo
)
{
log
.
Infof
(
"Bot进入了群 %v."
,
formatGroupName
(
group
))
bot
.
dispatchEventMessage
(
bot
.
groupIncrease
(
group
.
Code
,
0
,
c
.
Uin
))
...
...
go.mod
View file @
58a3f811
...
...
@@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
go 1.14
require (
github.com/Mrs4s/MiraiGo v0.0.0-20200
731150933-29a5a459fd85
github.com/Mrs4s/MiraiGo v0.0.0-20200
801022834-8f1c0c053a86
github.com/gin-gonic/gin v1.6.3
github.com/gorilla/websocket v1.4.2
github.com/guonaihong/gout v0.1.1
...
...
go.sum
View file @
58a3f811
...
...
@@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Mrs4s/MiraiGo v0.0.0-20200731150933-29a5a459fd85 h1:qLNIyNtxORtHJsBcuwFkKHSXgAffxCN5H9zYrWaAr+Y=
github.com/Mrs4s/MiraiGo v0.0.0-20200731150933-29a5a459fd85/go.mod h1:M9wh1hjd0rie3+wm27tjPZkYMbD+MBV76CGqp2G7WSU=
github.com/Mrs4s/MiraiGo v0.0.0-20200801022834-8f1c0c053a86 h1:Rnfejw8W7MX3nW15a1tDW3ybAq2y95iQFGZmcQUKuRs=
github.com/Mrs4s/MiraiGo v0.0.0-20200801022834-8f1c0c053a86/go.mod h1:M9wh1hjd0rie3+wm27tjPZkYMbD+MBV76CGqp2G7WSU=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
...
...
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