INNER CODE UNIT · Python

_CMD_DESC

PleasePrompto/ductor · ductor_bot/messenger/telegram/app.py:112

_CMD_DESC: dict[str, str] = {**dict(_COMMAND_DEFS), **dict(_MA_SUB_DEFS)}


def _rebuild_commands() -> None:
    """Rebuild module-level command lists from current translations."""
    global _BOT_COMMANDS  # noqa: PLW0603
    from ductor_bot.commands import get_bot_commands, get_multiagent_sub_commands

    cmd_defs = get_bot_commands()
    ma_defs = get_multiagent_sub_commands()
    _BOT_COMMANDS = [BotCommand(command=cmd, description=desc) for cmd, desc in cmd_defs]
    _CMD_DESC.clear()
    _CMD_DESC.update({**dict(cmd_defs), **dict(ma_defs)})


def _help_line(command: str) -> str:
    """Return one command line for the help panel."""
    description = _CMD_DESC.get(command, "")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…