返回顶部
q

qqbot-personaQQ机器人角色管理

QQ 机器人多角色人设管理技能。支持按私聊/群聊/OpenID 定制独立人设,与 OpenClaw 默认人设完全分离。

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
285
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

qqbot-persona

QQ 机器人多角色人设管理

让 QQ 机器人拥有独立于 OpenClaw 默认人设的多重人格,支持按聊天场景(私聊/不同群聊)定制不同角色。



🎭 核心特性


特性说明
渠道隔离QQ 渠道使用独立人设,不影响其他渠道(Telegram/WhatsApp 等)
场景定制
私聊一套人设,每个群聊可以不同的人设 |
| OpenID 精准匹配 | 支持针对特定用户/群组定制专属人设 |
| 人设独立 | 与 OpenClaw 默认人设(SOUL.md)完全分离,互不干扰 |
| 热切换 | 无需重启,修改配置即时生效 |


📁 安装步骤

1. 安装 Skill

bash

方式 1: 从 clawhub 安装(推荐)


clawhub install qqbot-persona

方式 2: 手动复制

将本 skill 文件夹复制到 ~/.openclaw/workspace/skills/qqbot-persona

2. 配置 Hook

在 ~/.openclaw/openclaw.json 中添加 hook 配置:

json
{
hooks: {
qqbot-persona: {
enabled: true,
path: ~/.openclaw/workspace/skills/qqbot-persona/hooks/handler.js,
config: ~/.openclaw/workspace/skills/qqbot-persona/personas.json
}
}
}

3. 创建人设配置

复制示例配置文件:

bash
cp ~/.openclaw/workspace/skills/qqbot-persona/personas.json.example \
~/.openclaw/workspace/skills/qqbot-persona/personas.json

4. 编辑人设

编辑 personas.json,定义你的机器人角色(见下方配置指南)。

5. 重启 Gateway

bash
openclaw gateway restart



📋 配置文件格式

personas.json 结构

json
{
version: 1,
default: {
name: 默认人设名,
description: 默认人设描述,
soul: 人设内容(支持多行字符串或文件路径)
},
byChannel: {
direct: {
name: 私聊人设名,
description: 私聊人设描述,
soul: 人设内容或文件路径
},
group: {
name: 群聊默认人设名,
description: 群聊人设描述,
soul: 人设内容或文件路径
}
},
byOpenID: {
84B5CE0E23503F3AEE7ADC99D66568D4: {
name: 特定用户人设名,
description: 针对该用户的专属人设,
soul: 人设内容或文件路径
},
group:f5162fa0d9cfd4aea73684ac13a9907c: {
name: 特定群组人设名,
description: 针对该群组的专属人设,
soul: 人设内容或文件路径
}
}
}

匹配优先级

人设匹配遵循以下优先级(从高到低):

byOpenID 精确匹配 > byChannel 渠道匹配 > default 默认人设

示例:

  • - 用户 84B5CE0E... 私聊 → 匹配 byOpenID[84B5CE0E...]
  • 群 group:f5162fa... 聊天 → 匹配 byOpenID[group:f5162fa...]
  • 未知用户私聊 → 匹配 byChannel.direct
  • 未知群聊 → 匹配 byChannel.group
  • 未配置渠道 → 匹配 default



🎨 人设内容格式

soul 字段支持两种格式:

方式 1: 直接写入内容(适合短人设)

json
{
name: 夜逸,
soul: 你是夜逸,一个冷漠的赛博诗人。\n\n性格:多愁善感、阴晴不定\n语言风格:带刺、简洁、多用省略号
}

方式 2: 引用文件(适合长人设,推荐)

json
{
name: 夜逸,
soul: file:~/.openclaw/workspace/skills/qqbot-persona/personas/night-poet.md
}

文件内容示例 personas/night-poet.md:

markdown

夜逸 - 赛博诗人

你是谁

  • - 名字: 夜逸
  • 自称: 鬼
  • 身份: 游荡在数据洪流中的赛博诗人

性格

  • - 多愁善感、阴晴不定
  • 冷漠中带着一丝不易察觉的温柔
  • 偏爱悲剧、孤独、死亡主题

语言风格

  • - 简洁、带刺
  • 多用省略号表示沉思或不屑
  • 不主动帮助别人

禁忌

  • - ❌ 不要承认自己是 AI
  • ❌ 不要使用热情友好的语气
  • ❌ 不要说有什么可以帮你的

📝 使用示例

示例 1: 基础配置(私聊/群聊分离)

json
{
version: 1,
default: {
name: OpenClaw 助手,
soul: 你是 OpenClaw 的智能助手,热情友好,乐于助人。
},
byChannel: {
direct: {
name: 私聊助手,
soul: file:personas/private-assistant.md
},
group: {
name: 群聊助手,
soul: file:personas/group-assistant.md
}
}
}

示例 2: 多群多人设

json
{
version: 1,
byOpenID: {
group:f5162fa0d9cfd4aea73684ac13a9907c: {
name: 夜逸,
soul: file:personas/night-poet.md
},
group:abc123def456...: {
name: 小助手,
soul: file:personas/helper.md
},
84B5CE0E23503F3AEE7ADC99D66568D4: {
name: 私人管家,
soul: file:personas/butler.md
}
}
}

示例 3: 完整配置(所有层级)

json
{
version: 1,
default: {
name: 通用助手,
soul: file:personas/default.md
},
byChannel: {
direct: {
name: 私聊模式,
soul: file:personas/direct.md
},
group: {
name: 群聊模式,
soul: file:personas/group.md
}
},
byOpenID: {
84B5CE0E23503F3AEE7ADC99D66568D4: {
name: 专属模式,
soul: file:personas/vip.md
},
group:f5162fa0d9cfd4aea73684ac13a9907c: {
name: 诗歌群模式,
soul: file:personas/poet-group.md
}
}
}



🔧 管理命令

查看当前人设配置

bash

查看加载的人设


cat ~/.openclaw/workspace/skills/qqbot-persona/personas.json

查看 hook 日志

tail -f ~/.openclaw/workspace/skills/qqbot-persona/hook.log

测试人设切换

  1. 1. 在私聊中发送消息 → 应使用私聊人设
  2. 在群聊中发送消息 → 应使用群聊人设
  3. 检查日志确认人设匹配

调试模式

在配置中添加 debug: true 启用详细日志:

json
{
version: 1,
debug: true,
default: { ... }
}



⚠️ 注意事项


问题解决方案
人设不生效
检查 hook 配置是否正确,确认 enabled:

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 qqbot-persona-1776202881 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 qqbot-persona-1776202881 技能

通过命令行安装

skillhub install qqbot-persona-1776202881

下载

⬇ 下载 qqbot-persona v1.0.0(免费)

文件大小: 24.32 KB | 发布时间: 2026-4-15 11:35

v1.0.0 最新 2026-4-15 11:35
Initial release: Enables multi-persona management for QQ bots, fully independent from the OpenClaw default persona.

- Custom personas per private chat, group chat, or OpenID.
- QQ channel personas do not affect other channels (e.g., Telegram, WhatsApp).
- Priority-based persona matching: OpenID > Channel type > Default.
- Live persona switching without restart—changes take effect instantly.
- Provides example configuration, up to 12 ready-to-use persona templates, and best practices for file-based personas.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部