diff --git a/CHANGELOG.md b/CHANGELOG.md index cad0cf0fe..0c0a8ca14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Docs: https://docs.clawd.bot ### Changes - Dependencies: update core + plugin deps (grammy, vitest, openai, Microsoft agents hosting, etc.). +- CLI: show Telegram bot username in channel status (probe/runtime). ### Fixes - Configure: hide OpenRouter auto routing model from the model picker. (#1182) — thanks @zerone0x. diff --git a/src/commands/channels.adds-non-default-telegram-account.test.ts b/src/commands/channels.adds-non-default-telegram-account.test.ts index 7a8c2ed29..d03be6a51 100644 --- a/src/commands/channels.adds-non-default-telegram-account.test.ts +++ b/src/commands/channels.adds-non-default-telegram-account.test.ts @@ -417,6 +417,22 @@ describe("channels command", () => { expect(lines.join("\n")).toMatch(/Telegram Bot API privacy mode/i); }); + it("includes Telegram bot username from probe data", () => { + const lines = formatGatewayChannelsStatusLines({ + channelAccounts: { + telegram: [ + { + accountId: "default", + enabled: true, + configured: true, + probe: { ok: true, bot: { username: "clawdbot_bot" } }, + }, + ], + }, + }); + expect(lines.join("\n")).toMatch(/bot:@clawdbot_bot/); + }); + it("surfaces Telegram group membership audit issues in channels status output", () => { const lines = formatGatewayChannelsStatusLines({ channelAccounts: { diff --git a/src/commands/channels/status.ts b/src/commands/channels/status.ts index dad94853d..521bf4c59 100644 --- a/src/commands/channels/status.ts +++ b/src/commands/channels/status.ts @@ -51,6 +51,18 @@ export function formatGatewayChannelsStatusLines(payload: Record 0) { bits.push(`mode:${account.mode}`); } + const botUsername = (() => { + const bot = account.bot as { username?: string | null } | undefined; + const probeBot = (account.probe as { bot?: { username?: string | null } } | undefined)?.bot; + const raw = bot?.username ?? probeBot?.username ?? ""; + if (typeof raw !== "string") return ""; + const trimmed = raw.trim(); + if (!trimmed) return ""; + return trimmed.startsWith("@") ? trimmed : `@${trimmed}`; + })(); + if (botUsername) { + bits.push(`bot:${botUsername}`); + } if (typeof account.dmPolicy === "string" && account.dmPolicy.length > 0) { bits.push(`dm:${account.dmPolicy}`); }