diff --git a/setup/channels/telegram.ts b/setup/channels/telegram.ts index 01a6675..9faf3b2 100644 --- a/setup/channels/telegram.ts +++ b/setup/channels/telegram.ts @@ -21,8 +21,9 @@ import * as p from '@clack/prompts'; import k from 'kleur'; import * as setupLog from '../logs.js'; +import { isHeadless } from '../platform.js'; import { BACK_TO_CHANNEL_SELECTION, type ChannelFlowResult } from '../lib/back-nav.js'; -import { confirmThenOpen, formatNoteLink } from '../lib/browser.js'; +import { confirmThenOpen, formatNoteLink, openUrl } from '../lib/browser.js'; import { brightSelect } from '../lib/bright-select.js'; import { askOperatorRole } from '../lib/role-prompt.js'; import { @@ -52,14 +53,37 @@ export async function runTelegramChannel(displayName: string): Promise line !== null).join('\n'), - 'Open Telegram', - ); - await confirmThenOpen(botUrl, 'Press Enter to open Telegram'); + 'Open Telegram', + ); + ensureAnswer( + await p.confirm({ + message: `Press Enter to open Telegram (must be installed here)\n${k.dim( + `If browser does not appear, please visit: ${botUrl} — or search for @${botUsername} in Telegram`, + )}`, + initialValue: true, + }), + ); + openUrl(botUrl); + } const install = await runQuietChild( 'telegram-install',