// Pure helpers for the public landing page, kept out of the Svelte component so the // Telegram-channel link selection is unit-testable. /** * telegramChannelLink returns the t.me link for the single bot's game channel, or null * when it is not configured. The channel username is a build-time var * (VITE_TELEGRAM_GAME_CHANNEL_NAME) because the test and prod contours run different * channels; it is the same channel the connector posts to via TELEGRAM_GAME_CHANNEL_ID * (the id to post, the name to link). A leading "@" is tolerated. */ export function telegramChannelLink(): string | null { const raw = import.meta.env.VITE_TELEGRAM_GAME_CHANNEL_NAME; const name = (raw as string | undefined)?.trim().replace(/^@/, ''); return name ? `https://t.me/${name}` : null; }