chore: clarify telegram docs links

This commit is contained in:
Peter Steinberger
2026-01-08 10:29:36 +01:00
parent 1232eb6f5e
commit b80b3a38bf
3 changed files with 12 additions and 3 deletions

View File

@@ -140,7 +140,8 @@ async function noteTelegramTokenHelp(prompter: WizardPrompter): Promise<void> {
"2) Run /newbot (or /mybots)",
"3) Copy the token (looks like 123456:ABC...)",
"Tip: you can also set TELEGRAM_BOT_TOKEN in your env.",
`Docs: ${formatDocsLink("/telegram", "telegram")}`,
`Docs: ${formatDocsLink("/telegram")}`,
"Website: https://clawd.bot",
].join("\n"),
"Telegram bot token",
);

View File

@@ -23,7 +23,8 @@ describe("provider registry", () => {
const line = formatProviderSelectionLine(first, (path, label) =>
[label, path].filter(Boolean).join(":"),
);
expect(line).toContain("Docs:");
expect(line).toContain("telegram");
expect(line).not.toContain("Docs:");
expect(line).toContain("/telegram");
expect(line).toContain("https://clawd.bot");
});
});

View File

@@ -75,6 +75,8 @@ const CHAT_PROVIDER_ALIASES: Record<string, ChatProviderId> = {
imsg: "imessage",
};
const WEBSITE_URL = "https://clawd.bot";
export function listChatProviders(): ChatProviderMeta[] {
return CHAT_PROVIDER_ORDER.map((id) => CHAT_PROVIDER_META[id]);
}
@@ -102,6 +104,11 @@ export function formatProviderSelectionLine(
meta: ChatProviderMeta,
docsLink: (path: string, label?: string) => string,
): string {
if (meta.id === "telegram") {
return `${meta.label}${meta.blurb} ${docsLink(
meta.docsPath,
)} ${WEBSITE_URL}`;
}
return `${meta.label}${meta.blurb} Docs: ${docsLink(
meta.docsPath,
meta.docsLabel ?? meta.id,