mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
fix #10
This commit is contained in:
parent
e754bd36ed
commit
d5bff2ad8b
@ -136,6 +136,7 @@ func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage) int32 {
|
||||
"message": ToStringMessage(m.Elements, m.GroupCode, true),
|
||||
}
|
||||
id := ToGlobalId(m.GroupCode, m.Id)
|
||||
if bot.db != nil {
|
||||
err := bot.db.Update(func(tx *nutsdb.Tx) error {
|
||||
buf := new(bytes.Buffer)
|
||||
if err := gob.NewEncoder(buf).Encode(val); err != nil {
|
||||
@ -147,6 +148,7 @@ func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage) int32 {
|
||||
log.Warnf("记录聊天数据时出现错误: %v", err)
|
||||
return -1
|
||||
}
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user