This commit is contained in:
2026-01-08 18:46:14 +08:00
parent 472b1a0d5e
commit 4016c1e6eb
7 changed files with 2815 additions and 1470 deletions

View File

@@ -1548,7 +1548,14 @@ class AIChat(PluginBase):
if content == clear_command:
chat_id = self._get_chat_id(from_wxid, user_wxid, is_group)
self._clear_memory(chat_id)
await bot.send_text(from_wxid, "✅ 已清空当前会话的记忆")
# 如果是群聊,还需要清空群聊历史
if is_group and self.store:
history_chat_id = self._get_group_history_chat_id(from_wxid, user_wxid)
await self.store.clear_group_history(history_chat_id)
await bot.send_text(from_wxid, "✅ 已清空当前群聊的记忆和历史记录")
else:
await bot.send_text(from_wxid, "✅ 已清空当前会话的记忆")
return False
# 检查是否是上下文统计指令