fix(pairing): show actual code in approval command instead of placeholder (#13723)
* fix(pairing): show actual code in approval command instead of placeholder The pairing reply shown to new users included the approval command with a literal '<code>' placeholder. Users had to manually copy the code from one line and substitute it into the command. Now shows the ready-to-copy command with the real pairing code: Before: openclaw pairing approve telegram <code> After: openclaw pairing approve telegram abc123 Fixed in both the shared pairing message builder and the Telegram inline pairing reply. * test(pairing): update test to expect actual code instead of placeholder --------- Co-authored-by: Echo Ito <echoito@MacBook-Air.local>
This commit is contained in:
@@ -52,7 +52,7 @@ describe("buildPairingReply", () => {
|
||||
expect(text).toContain(`Pairing code: ${testCase.code}`);
|
||||
// CLI commands should respect OPENCLAW_PROFILE when set (most tests run with isolated profile)
|
||||
const commandRe = new RegExp(
|
||||
`(?:openclaw|openclaw) --profile isolated pairing approve ${testCase.channel} <code>`,
|
||||
`(?:openclaw|openclaw) --profile isolated pairing approve ${testCase.channel} ${testCase.code}`,
|
||||
);
|
||||
expect(text).toMatch(commandRe);
|
||||
});
|
||||
|
||||
@@ -15,6 +15,6 @@ export function buildPairingReply(params: {
|
||||
`Pairing code: ${code}`,
|
||||
"",
|
||||
"Ask the bot owner to approve with:",
|
||||
formatCliCommand(`openclaw pairing approve ${channel} <code>`),
|
||||
formatCliCommand(`openclaw pairing approve ${channel} ${code}`),
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ export const buildTelegramMessageContext = async ({
|
||||
`Pairing code: ${code}`,
|
||||
"",
|
||||
"Ask the bot owner to approve with:",
|
||||
formatCliCommand("openclaw pairing approve telegram <code>"),
|
||||
formatCliCommand(`openclaw pairing approve telegram ${code}`),
|
||||
].join("\n"),
|
||||
),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user