refactor: QQ → OBv11 重命名 + 平台格式统一抽象

- 所有对外称呼从 QQ 改为 OBv11(注释/提示词/日志/配置项)
- 新增 PlatformFormat 结构体,统一管理平台消息标记格式
- defaultPlatformFormats() 注册表替代硬编码 qqTargetRe
- extractProactiveMessage 改为 Thinker 方法,遍历格式注册表匹配
- 配置项重命名: QQ_BOT_PORT → OBV11_BOT_PORT, QQBotPort → OBv11BotPort
- 标记格式: 【QQ群聊】→【OBv11群聊】、【QQ私聊】→【OBv11私聊】

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-22 20:48:07 +08:00
parent 70dbb23234
commit 41f653b672
25 changed files with 1609 additions and 82 deletions
@@ -14,7 +14,7 @@ type Config struct {
InternalToken string
// Platform-specific.
QQBotPort string // port for QQ OBv11 reverse WebSocket
OBv11BotPort string // port for OBv11 reverse WebSocket
TelegramToken string // Telegram Bot API token
TelegramWebhookURL string // public webhook URL for Telegram
@@ -34,7 +34,7 @@ func Load() *Config {
Env: "development",
GatewayURL: "http://localhost:8080",
AICoreURL: "http://localhost:8081",
QQBotPort: "8096",
OBv11BotPort: "8096",
}
if v := os.Getenv("PORT"); v != "" {
cfg.Port = v
@@ -51,8 +51,8 @@ func Load() *Config {
if v := os.Getenv("INTERNAL_SERVICE_TOKEN"); v != "" {
cfg.InternalToken = v
}
if v := os.Getenv("QQ_BOT_PORT"); v != "" {
cfg.QQBotPort = v
if v := os.Getenv("OBV11_BOT_PORT"); v != "" {
cfg.OBv11BotPort = v
}
if v := os.Getenv("TELEGRAM_BOT_TOKEN"); v != "" {
cfg.TelegramToken = v