1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

feat: mark message readed.

This commit is contained in:
Mrs4s 2021-05-24 14:38:07 +08:00
parent 9a8ac6fd00
commit f6f31a87f9
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
2 changed files with 7 additions and 0 deletions

View File

@ -64,6 +64,9 @@ func (bot *CQBot) privateMessageEvent(c *client.QQClient, m *message.PrivateMess
},
}
bot.dispatchEventMessage(fm)
if m.Sender.Uin != c.Uin {
c.MarkPrivateMessageReaded(m.Sender.Uin, int64(m.Time))
}
}
func (bot *CQBot) groupMessageEvent(c *client.QQClient, m *message.GroupMessage) {
@ -101,6 +104,9 @@ func (bot *CQBot) groupMessageEvent(c *client.QQClient, m *message.GroupMessage)
}
gm["message_id"] = id
bot.dispatchEventMessage(gm)
if m.Sender.Uin != c.Uin {
c.MarkGroupMessageReaded(m.GroupCode, int64(m.Id))
}
}
func (bot *CQBot) tempMessageEvent(c *client.QQClient, e *client.TempMessageEvent) {

1
go.sum
View File

@ -13,6 +13,7 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gin-contrib/pprof v1.3.0 h1:G9eK6HnbkSqDZBYbzG4wrjCsA4e+cvYAHUZw6W+W9K0=
github.com/gin-contrib/pprof v1.3.0/go.mod h1:waMjT1H9b179t3CxuG1cV3DHpga6ybizwfBaM5OXaB0=