File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments