Files
qqbot/scripts/upgrade.sh
rianli 50422aac14 feat(qqbot): 流式消息输出与架构重构
**流式消息**
- 新增 StreamSender 类,支持流式消息分片发送
- 实现消息队列异步处理,防止阻塞心跳
- 支持 C2C/Group 流式消息

**架构重构**
- 移除 clawdbot/moltbot 旧配置,统一为 qqbot
- 新增 upgrade-and-run.sh 一键升级脚本
- 重构 api/channel/gateway/outbound 模块
- 新增富媒体消息发送接口
2026-02-02 20:25:06 +08:00

62 lines
1.8 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# QQBot 插件升级脚本
# 用于清理旧版本插件并重新安装
set -e
OPENCLAW_DIR="$HOME/.openclaw"
CONFIG_FILE="$OPENCLAW_DIR/openclaw.json"
EXTENSION_DIR="$OPENCLAW_DIR/extensions/qqbot"
echo "=== QQBot 插件升级脚本 ==="
# 1. 删除旧的扩展目录
if [ -d "$EXTENSION_DIR" ]; then
echo "删除旧版本插件: $EXTENSION_DIR"
rm -rf "$EXTENSION_DIR"
else
echo "未找到旧版本插件目录,跳过删除"
fi
# 2. 清理配置文件中的 qqbot 相关字段
if [ -f "$CONFIG_FILE" ]; then
echo "清理配置文件中的 qqbot 字段..."
# 使用 node 处理 JSON比 jq 更可靠处理复杂结构)
node -e "
const fs = require('fs');
const config = JSON.parse(fs.readFileSync('$CONFIG_FILE', 'utf8'));
// 删除 channels.qqbot
if (config.channels && config.channels.qqbot) {
delete config.channels.qqbot;
console.log(' - 已删除 channels.qqbot');
}
// 删除 plugins.entries.qqbot
if (config.plugins && config.plugins.entries && config.plugins.entries.qqbot) {
delete config.plugins.entries.qqbot;
console.log(' - 已删除 plugins.entries.qqbot');
}
// 删除 plugins.installs.qqbot
if (config.plugins && config.plugins.installs && config.plugins.installs.qqbot) {
delete config.plugins.installs.qqbot;
console.log(' - 已删除 plugins.installs.qqbot');
}
fs.writeFileSync('$CONFIG_FILE', JSON.stringify(config, null, 2));
console.log('配置文件已更新');
"
else
echo "未找到配置文件: $CONFIG_FILE"
fi
echo ""
echo "=== 清理完成 ==="
echo ""
echo "接下来请执行以下命令重新安装插件:"
echo " cd /path/to/qqbot"
echo " openclaw plugins install ."
echo " openclaw channels add --channel qqbot --token \"AppID:AppSecret\""
echo " openclaw gateway restart"