From 2466d9e1dc40405ad996f75fbf181e172866ce10 Mon Sep 17 00:00:00 2001 From: Cheng Wang Date: Tue, 3 Feb 2026 00:37:55 +0800 Subject: [PATCH] fix: add Telegram channel to channels status command Previously, the `nanobot channels status` command only displayed WhatsApp channel status, completely omitting Telegram despite it being fully implemented in the codebase. Changes: - Added Telegram channel status display - Renamed "Bridge URL" column to "Configuration" for better generality - Show Telegram token (first 10 chars) or "not configured" message - Added comments to distinguish WhatsApp and Telegram sections Fixes the issue where users couldn't see Telegram channel status via CLI, even though the feature was working correctly. --- nanobot/cli/commands.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py index d293564..3bddb62 100644 --- a/nanobot/cli/commands.py +++ b/nanobot/cli/commands.py @@ -348,21 +348,31 @@ app.add_typer(channels_app, name="channels") def channels_status(): """Show channel status.""" from nanobot.config.loader import load_config - + config = load_config() - + table = Table(title="Channel Status") table.add_column("Channel", style="cyan") table.add_column("Enabled", style="green") - table.add_column("Bridge URL", style="yellow") - + table.add_column("Configuration", style="yellow") + + # WhatsApp wa = config.channels.whatsapp table.add_row( "WhatsApp", "✓" if wa.enabled else "✗", wa.bridge_url ) - + + # Telegram + tg = config.channels.telegram + tg_config = f"token: {tg.token[:10]}..." if tg.token else "[dim]not configured[/dim]" + table.add_row( + "Telegram", + "✓" if tg.enabled else "✗", + tg_config + ) + console.print(table)