修复机器人聊天记录与修改机器人信息

This commit is contained in:
2026-06-14 21:17:49 +08:00
parent 491876284e
commit 0024841ffb
9 changed files with 460 additions and 54 deletions
+3
View File
@@ -395,6 +395,7 @@ func (s *botService) recordOutboundDirectMessage(bot *botNodeRecord, msg *botMes
id := msg.ID
botMessageID = &id
}
now := time.Now()
dm := &botDirectMessageRecord{
BotID: bot.ID,
BotNodeID: bot.NodeID,
@@ -414,6 +415,8 @@ func (s *botService) recordOutboundDirectMessage(bot *botNodeRecord, msg *botMes
BotMessageID: botMessageID,
CreatedBy: createdByPtr,
PublishedAt: msg.PublishedAt,
// 出向消息从产生那一刻起就视为“已读”,未读计数只关心 inbound。
ReadAt: &now,
}
if err := s.store.InsertBotDirectMessage(dm); err != nil {
printJSON(map[string]any{