























@@ -4,9 +4,40 @@ import { getPluginVersionString, resolveRuntimeServiceVersion } from "./state.js
44const QQBOT_PLUGIN_GITHUB_URL = "https://github.com/openclaw/openclaw/tree/main/extensions/qqbot";
55const QQBOT_UPGRADE_GUIDE_URL = "https://q.qq.com/qqbot/openclaw/upgrade.html";
667-const GROUP_EXCLUDED = new Set(["bot-upgrade", "bot-clear-storage", "bot-streaming"]);
8-97export function registerBasicBotCommands(registry: SlashCommandRegistry): void {
8+registry.register({
9+name: "bot-help",
10+description: "查看所有内置命令",
11+usage: [
12+`/bot-help`,
13+``,
14+`查看所有可用的 QQBot 内置命令及其简要说明。`,
15+`在命令后追加 ? 可查看详细用法。`,
16+].join("\n"),
17+handler: (ctx) => {
18+const isGroup = ctx.type === "group";
19+const lines = [`### QQBot 内置命令`, ``];
20+for (const [name, cmd] of registry.getAllCommands()) {
21+if (isGroup && cmd.c2cOnly) {
22+continue;
23+}
24+lines.push(`<qqbot-cmd-input text="/${name}" show="/${name}"/> ${cmd.description}`);
25+}
26+lines.push(``, `> 插件版本 v${getPluginVersionString()}`);
27+return lines.join("\n");
28+},
29+});
30+31+registry.register({
32+name: "bot-me",
33+description: "查看当前发送者的账号ID",
34+c2cOnly: true,
35+usage: [`/bot-me`, ``, `显示当前发送者的账号ID`].join("\n"),
36+handler: (ctx) => {
37+return `你的账号ID:\`${ctx.senderId}\``;
38+},
39+});
40+1041registry.register({
1142name: "bot-ping",
1243description: "测试 OpenClaw 与 QQ 之间的网络延迟",
@@ -39,6 +70,7 @@ export function registerBasicBotCommands(registry: SlashCommandRegistry): void {
3970registry.register({
4071name: "bot-version",
4172description: "查看 QQBot 插件版本和 OpenClaw 框架版本",
73+c2cOnly: true,
4274usage: [`/bot-version`, ``, `查看当前 QQBot 插件版本和 OpenClaw 框架版本。`].join("\n"),
4375handler: async () => {
4476const frameworkVersion = resolveRuntimeServiceVersion();
@@ -55,31 +87,9 @@ export function registerBasicBotCommands(registry: SlashCommandRegistry): void {
5587registry.register({
5688name: "bot-upgrade",
5789description: "查看 QQBot 升级指引",
90+c2cOnly: true,
5891usage: [`/bot-upgrade`, ``, `查看 QQBot 升级说明。`].join("\n"),
5992handler: () =>
6093[`📘 QQBot 升级指引:`, `[点击查看升级说明](${QQBOT_UPGRADE_GUIDE_URL})`].join("\n"),
6194});
62-63-registry.register({
64-name: "bot-help",
65-description: "查看所有内置命令",
66-usage: [
67-`/bot-help`,
68-``,
69-`查看所有可用的 QQBot 内置命令及其简要说明。`,
70-`在命令后追加 ? 可查看详细用法。`,
71-].join("\n"),
72-handler: (ctx) => {
73-const isGroup = ctx.type === "group";
74-const lines = [`### QQBot 内置命令`, ``];
75-for (const [name, cmd] of registry.getAllCommands()) {
76-if (isGroup && GROUP_EXCLUDED.has(name)) {
77-continue;
78-}
79-lines.push(`<qqbot-cmd-input text="/${name}" show="/${name}"/> ${cmd.description}`);
80-}
81-lines.push(``, `> 插件版本 v${getPluginVersionString()}`);
82-return lines.join("\n");
83-},
84-});
8595}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。