feat(mcp): add slash command listing

This commit is contained in:
Hua
2026-03-19 13:10:07 +08:00
parent 49fbd5c15c
commit cfcfb35f81
9 changed files with 180 additions and 3 deletions

View File

@@ -1,5 +1,3 @@
import asyncio
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import AsyncMock
@@ -206,6 +204,13 @@ def test_is_allowed_rejects_invalid_legacy_telegram_sender_shapes() -> None:
assert channel.is_allowed("not-a-number|alice") is False
def test_build_bot_commands_includes_mcp() -> None:
commands = TelegramChannel._build_bot_commands("en")
descriptions = {command.command: command.description for command in commands}
assert descriptions["mcp"] == "List MCP servers and tools"
@pytest.mark.asyncio
async def test_send_progress_keeps_message_in_topic() -> None:
config = TelegramConfig(enabled=True, token="123:abc", allow_from=["*"])