From 61f0923c66a12980d4e6420ba318ceac54276046 Mon Sep 17 00:00:00 2001 From: Xubin Ren Date: Sat, 14 Mar 2026 10:45:37 +0000 Subject: [PATCH] fix(telegram): include restart in help text --- nanobot/channels/telegram.py | 1 + tests/test_telegram_channel.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/nanobot/channels/telegram.py b/nanobot/channels/telegram.py index 9ffc208..a5942da 100644 --- a/nanobot/channels/telegram.py +++ b/nanobot/channels/telegram.py @@ -453,6 +453,7 @@ class TelegramChannel(BaseChannel): "🐈 nanobot commands:\n" "/new — Start a new conversation\n" "/stop — Stop the current task\n" + "/restart — Restart the bot\n" "/help — Show available commands" ) diff --git a/tests/test_telegram_channel.py b/tests/test_telegram_channel.py index 70feef5..c96f5e4 100644 --- a/tests/test_telegram_channel.py +++ b/tests/test_telegram_channel.py @@ -597,3 +597,19 @@ async def test_forward_command_does_not_inject_reply_context() -> None: assert len(handled) == 1 assert handled[0]["content"] == "/new" + + +@pytest.mark.asyncio +async def test_on_help_includes_restart_command() -> None: + channel = TelegramChannel( + TelegramConfig(enabled=True, token="123:abc", allow_from=["*"], group_policy="open"), + MessageBus(), + ) + update = _make_telegram_update(text="/help", chat_type="private") + update.message.reply_text = AsyncMock() + + await channel._on_help(update, None) + + update.message.reply_text.assert_awaited_once() + help_text = update.message.reply_text.await_args.args[0] + assert "/restart" in help_text