Skip to content

fix(telegram): pipe table auto-rich bypasses rich_messages: false config #53824

Description

@pizzav-xyz

Bug Description

Commit 9d225fbf4 (fix(telegram): auto-rich pipe tables and topic routing for sendRichMessage) added _content_is_pipe_table_primary() which forces pipe-table content through sendRichMessage even when rich_messages: false is configured.

This reintroduces the "This message is not supported on your version of Telegram" error on clients that don't support Bot API 10.1 rich messages (AyuGram, Telegram Web, some desktop clients).

Root Cause

_rich_delivery_enabled() was changed to:

def _rich_delivery_enabled(self, content: str) -> bool:
    return bool(
        getattr(self, "_rich_messages_enabled", True)
        or self._content_is_pipe_table_primary(content)  # ← bypasses config
    )

The or clause means pipe tables always go through sendRichMessage regardless of the rich_messages opt-in setting.

Expected Behavior

When platforms.telegram.extra.rich_messages: false is set, no content should be sent via sendRichMessage — including pipe tables. The legacy MarkdownV2 path should be used for all content.

Actual Behavior

Pipe tables are auto-routed to sendRichMessage even with rich_messages: false, breaking delivery on AyuGram and Telegram Web.

Fix

Remove the or self._content_is_pipe_table_primary(content) bypass from _rich_delivery_enabled() so the config flag is fully respected.

def _rich_delivery_enabled(self, content: str) -> bool:
    return bool(
        getattr(self, "_rich_messages_enabled", True)
    )

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliveryplatform/telegramTelegram bot adaptersweeper:risk-message-deliverySweeper risk: may drop, duplicate, misroute, or suppress messagestype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions