chore: clarify telegram docs links
This commit is contained in:
@@ -140,7 +140,8 @@ async function noteTelegramTokenHelp(prompter: WizardPrompter): Promise<void> {
|
|||||||
"2) Run /newbot (or /mybots)",
|
"2) Run /newbot (or /mybots)",
|
||||||
"3) Copy the token (looks like 123456:ABC...)",
|
"3) Copy the token (looks like 123456:ABC...)",
|
||||||
"Tip: you can also set TELEGRAM_BOT_TOKEN in your env.",
|
"Tip: you can also set TELEGRAM_BOT_TOKEN in your env.",
|
||||||
`Docs: ${formatDocsLink("/telegram", "telegram")}`,
|
`Docs: ${formatDocsLink("/telegram")}`,
|
||||||
|
"Website: https://clawd.bot",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
"Telegram bot token",
|
"Telegram bot token",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ describe("provider registry", () => {
|
|||||||
const line = formatProviderSelectionLine(first, (path, label) =>
|
const line = formatProviderSelectionLine(first, (path, label) =>
|
||||||
[label, path].filter(Boolean).join(":"),
|
[label, path].filter(Boolean).join(":"),
|
||||||
);
|
);
|
||||||
expect(line).toContain("Docs:");
|
expect(line).not.toContain("Docs:");
|
||||||
expect(line).toContain("telegram");
|
expect(line).toContain("/telegram");
|
||||||
|
expect(line).toContain("https://clawd.bot");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ const CHAT_PROVIDER_ALIASES: Record<string, ChatProviderId> = {
|
|||||||
imsg: "imessage",
|
imsg: "imessage",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const WEBSITE_URL = "https://clawd.bot";
|
||||||
|
|
||||||
export function listChatProviders(): ChatProviderMeta[] {
|
export function listChatProviders(): ChatProviderMeta[] {
|
||||||
return CHAT_PROVIDER_ORDER.map((id) => CHAT_PROVIDER_META[id]);
|
return CHAT_PROVIDER_ORDER.map((id) => CHAT_PROVIDER_META[id]);
|
||||||
}
|
}
|
||||||
@@ -102,6 +104,11 @@ export function formatProviderSelectionLine(
|
|||||||
meta: ChatProviderMeta,
|
meta: ChatProviderMeta,
|
||||||
docsLink: (path: string, label?: string) => string,
|
docsLink: (path: string, label?: string) => string,
|
||||||
): string {
|
): string {
|
||||||
|
if (meta.id === "telegram") {
|
||||||
|
return `${meta.label} — ${meta.blurb} ${docsLink(
|
||||||
|
meta.docsPath,
|
||||||
|
)} ${WEBSITE_URL}`;
|
||||||
|
}
|
||||||
return `${meta.label} — ${meta.blurb} Docs: ${docsLink(
|
return `${meta.label} — ${meta.blurb} Docs: ${docsLink(
|
||||||
meta.docsPath,
|
meta.docsPath,
|
||||||
meta.docsLabel ?? meta.id,
|
meta.docsLabel ?? meta.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user