Skip to content

Commit a9a7d17

Browse files
AliceLJYclaude
andcommitted
feat: add aliases for /relay targets (cc/cx/gm)
cc=claude, cx=codex, gm=gemini — less typing from phone. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ef3eaa8 commit a9a7d17

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

bridge.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,15 +1232,20 @@ bot.command("relay", async (ctx) => {
12321232

12331233
const raw = ctx.match?.trim() || "";
12341234
const spaceIdx = raw.indexOf(" ");
1235-
const targetName = spaceIdx > 0 ? raw.slice(0, spaceIdx).toLowerCase() : raw.toLowerCase();
1235+
const rawTarget = spaceIdx > 0 ? raw.slice(0, spaceIdx).toLowerCase() : raw.toLowerCase();
12361236
const message = spaceIdx > 0 ? raw.slice(spaceIdx + 1).trim() : "";
12371237
const peers = a2aBus.getPeerNames();
12381238

1239+
// 简写映射:cc→claude, cx→codex, gm→gemini
1240+
const ALIASES = { cc: "claude", cx: "codex", gm: "gemini" };
1241+
const targetName = ALIASES[rawTarget] || rawTarget;
1242+
12391243
if (!targetName || !message) {
12401244
await ctx.reply(
12411245
`用法: /relay <target> <message>\n\n` +
12421246
`可用目标: ${peers.join(", ") || "无"}\n` +
1243-
`示例: /relay ${peers[0] || "codex"} 你好,介绍一下自己`
1247+
`简写: cc=claude, cx=codex, gm=gemini\n` +
1248+
`示例: /relay cx 你好,介绍一下自己`
12441249
);
12451250
return;
12461251
}

0 commit comments

Comments
 (0)