1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-06 20:13:50 +08:00

add: honor changed event.

This commit is contained in:
Mrs4s 2020-09-13 20:16:01 +08:00
parent e9db10c9b7
commit 6101c4d8a9
3 changed files with 26 additions and 3 deletions

View File

@ -238,6 +238,29 @@ func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e client.IGroupNotifyEven
"lucky_king_id": notify.LuckyKing,
"time": time.Now().Unix(),
})
case *client.MemberHonorChangedNotifyEvent:
log.Info(notify.Content())
bot.dispatchEventMessage(MSG{
"post_type": "notice",
"group_id": group.Code,
"notice_type": "notify",
"notify_type": "honor",
"self_id": c.Uin,
"user_id": notify.Uin,
"time": time.Now().Unix(),
"honor_type": func() string {
switch notify.Honor {
case client.Talkative:
return "talkative"
case client.Performer:
return "performer"
case client.Emotion:
return "emotion"
default:
return "ERROR"
}
}(),
})
}
}

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
go 1.14
require (
github.com/Mrs4s/MiraiGo v0.0.0-20200912123655-d92d61c5998e
github.com/Mrs4s/MiraiGo v0.0.0-20200913112343-ad5531c3db09
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/gin-gonic/gin v1.6.3
github.com/go-playground/validator/v10 v10.3.0 // indirect

4
go.sum
View File

@ -1,7 +1,7 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Mrs4s/MiraiGo v0.0.0-20200912123655-d92d61c5998e h1:wiaXXMPnYCfA+rX1wy9SNrDyW3O43wfun5dIYKKK3BI=
github.com/Mrs4s/MiraiGo v0.0.0-20200912123655-d92d61c5998e/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20200913112343-ad5531c3db09 h1:zTe9IBmO+z6icSwjT2PgI9aMIIwlfWc00cFEz2+j9rc=
github.com/Mrs4s/MiraiGo v0.0.0-20200913112343-ad5531c3db09/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
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=