Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ dmypy.json
# IDE
.vscode/
.idea/
*.code-workspace
*.swp
*.swo
*~
Expand Down
83 changes: 0 additions & 83 deletions CHANGELOG.md

This file was deleted.

8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

![SpectreCore](https://avatars.githubusercontent.com/u/129108081?s=48&v=4)

[![version](https://img.shields.io/badge/version-v2.1.10-blue.svg?style=flat-square)](https://github.com/23q3/astrbot_plugin_SpectreCore)
[![version](https://img.shields.io/badge/version-v2.1.11-blue.svg?style=flat-square)](https://github.com/23q3/astrbot_plugin_SpectreCore)
[![license](https://img.shields.io/badge/license-AGPL--3.0-green.svg?style=flat-square)](LICENSE)
[![author](https://img.shields.io/badge/author-23q3-orange.svg?style=flat-square)](https://github.com/23q3)

Expand Down Expand Up @@ -70,11 +70,9 @@ SpectreCore (影芯) 是一个为 AstrBot 设计的高级群聊互动插件,

## 📋 最新版本

### v2.1.10 (2026-01-07)
### v2.1.11 (2026-02-24)

- ✨ **新增群聊黑名单和全局回复开关** - 添加群聊黑名单功能,可禁用指定群的自动回复;新增全局回复开关,一键启用/禁用所有群的自动回复功能 [#61](https://github.com/23q3/astrbot_plugin_SpectreCore/issues/61)[#83](https://github.com/23q3/astrbot_plugin_SpectreCore/issues/83)
- 🔄 **使用AstrBot原生UMO人格机制** - 移除自定义人格注入逻辑,改用AstrBot原生的Unified Model Output人格机制,提高兼容性和稳定性 [#77](https://github.com/23q3/astrbot_plugin_SpectreCore/issues/77)
- 🐛 **修复当前消息图片未被转述** - 修复当前消息中的图片未被包含在历史记录转述中的问题 [#84](https://github.com/23q3/astrbot_plugin_SpectreCore/issues/84)[#85](https://github.com/23q3/astrbot_plugin_SpectreCore/pull/85) @lymangos
- 🐛 **修复机器人私聊消息存储路径错误** - 修复私聊中bot消息存入错误路径,导致用户看不到bot回复历史的问题 [#87](https://github.com/23q3/astrbot_plugin_SpectreCore/issues/87)[#90](https://github.com/23q3/astrbot_plugin_SpectreCore/pull/90) @Hola-Gracias

## ⚠️ 注意事项

Expand Down
1 change: 1 addition & 0 deletions changelogs/v2.1.11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- 🐛 **修复机器人私聊消息存储路径错误** - 修复私聊中bot消息存入错误路径,导致用户看不到bot回复历史的问题 [#87](https://github.com/23q3/astrbot_plugin_SpectreCore/issues/87)[#90](https://github.com/23q3/astrbot_plugin_SpectreCore/pull/90) @Hola-Gracias
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"spectrecore",
"23q3",
"使大模型更好的主动回复群聊中的消息,带来生动和沉浸的群聊对话体验",
"2.1.10",
"2.1.11",
"https://github.com/23q3/astrbot_plugin_SpectreCore"
)
class SpectreCore(Star):
Expand Down
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: spectrecore # 这是你的插件的唯一识别名。
desc: 使大模型更好的主动回复群聊中的消息,带来生动和沉浸的群聊对话体验 # 插件简短描述
help: 自动检测群聊消息并让AI模型进行回复,让群聊更加生动有趣。 # 插件的帮助信息
version: v2.1.10 # 插件版本号。格式:v1.1.1 或者 v1.1
version: v2.1.11 # 插件版本号。格式:v1.1.1 或者 v1.1
author: 23q3 # 作者
repo: https://github.com/23q3/astrbot_plugin_SpectreCore # 插件的仓库地址
display_name: 🌟 SpectreCore
13 changes: 9 additions & 4 deletions utils/history_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,25 @@ def _sanitize_message(message: AstrBotMessage) -> AstrBotMessage:
return sanitized_message

@staticmethod
async def save_message(message: AstrBotMessage, platform_name: str) -> bool:
async def save_message(message: AstrBotMessage, platform_name: str, chat_id_override: str | None = None) -> bool:
"""
保存消息到历史记录

Args:
message: AstrBot消息对象
platform_name: 平台名称
chat_id_override: 可选,强制指定存储用的聊天ID(用于bot消息存入正确的会话文件)

Returns:
是否保存成功
"""
try:
# 判断是群聊还是私聊
is_private_chat = not bool(message.group_id)

if is_private_chat:

if chat_id_override is not None:
chat_id = str(chat_id_override)
elif is_private_chat:
chat_id = message.sender.user_id
else:
chat_id = message.group_id
Expand Down Expand Up @@ -263,7 +266,9 @@ async def save_bot_message_from_chain(chain: List[BaseMessageComponent], event:
bot_msg = HistoryStorage.create_bot_message(chain, event)

# 保存消息
return await HistoryStorage.save_message(bot_msg, event.get_platform_name())
is_private = event.is_private_chat()
chat_id = event.get_sender_id() if is_private else event.get_group_id()
return await HistoryStorage.save_message(bot_msg, event.get_platform_name(), chat_id_override=chat_id)
except Exception as e:
logger.error(f"保存机器人消息失败: {e}")
return False
Expand Down