@smonett

Telegram Table Fix

Converts Markdown tables to mobile-readable card layout before Telegram delivery. Uses emoji + box-drawing card format recommended by 4-model frontier panel.

当前版本
v1.0.0
code-plugin社区source-linked

telegram-table-fix

An OpenClaw plugin that intercepts outbound Telegram messages and converts Markdown tables to a mobile-readable card layout — before delivery, at the transport layer.

The problem

Telegram does not render Markdown tables. When an LLM generates a table in its response, Telegram users see raw ASCII pipes and dashes — or worse, the platform wraps the table in a code block that's tiny and requires horizontal scrolling on mobile.

This is a runtime formatting problem that belongs in the runtime, not in the model prompt. No amount of "don't use tables in Telegram" system instructions will catch every case.

The solution

This plugin hooks into message_sending and rewrites any Markdown table into a vertical card layout before the message reaches Telegram. The model never knows it happened — it generates the best format for the content, and the plugin handles the channel constraint.

Card layout (3+ columns)

Input:

| Project | Status | Priority |
|---|---|---|
| telegram-table-fix | Testing | P1 |
| agent-stack | 64% coverage | P0 |

Output:

🔹 **telegram-table-fix**
├ **Status:** Testing
└ **Priority:** P1

🔹 **agent-stack**
├ **Status:** 64% coverage
└ **Priority:** P0

Key-value layout (2 columns)

Input:

| Setting | Value |
|---|---|
| Model | claude-sonnet-4-6 |
| Context | continuation-skip |

Output:

• **Model** — claude-sonnet-4-6
• **Context** — continuation-skip

Why this format?

The card layout was selected after a 4-model frontier panel evaluation (Grok 4.3, Claude Opus 4.7, GPT-5.5-pro, Gemini 3.1 Pro). All four models converged on the same recommendation: labeled vertical cards with emoji anchors and box-drawing characters for visual grouping.

Key advantages on mobile Telegram:

  • No horizontal alignment — survives any screen width
  • Self-describing — column headers become inline labels, so context is preserved when messages are forwarded or quoted
  • Visual grouping — emoji anchors (🔹) and tree characters (, ) make row boundaries obvious at a glance
  • Width-independent — only uses vertical space; no wrapping breakage

Installation

From ClawHub

clawhub package install telegram-table-fix

Manual

Copy the plugin to your extensions directory:

cp -r telegram-table-fix ~/.openclaw/extensions/

Configuration

The plugin requires conversation access to read and rewrite outbound messages. Add this to your openclaw.json:

{
  "plugins": {
    "entries": {
      "telegram-table-fix": {
        "enabled": true,
        "hooks": {
          "allowConversationAccess": true
        }
      }
    }
  }
}

Then restart the gateway (openclaw gateway restart or SIGUSR1).

How it works

  1. Hooks into message_sending (fires before channel delivery)
  2. Checks if the target channel is Telegram (ctx.channelId)
  3. Scans the message content for Markdown table patterns (|...|)
  4. Parses tables into headers + rows
  5. Converts to the appropriate format (card layout for 3+ columns, key-value for 2 columns)
  6. Returns the rewritten content; non-table content passes through unchanged

The plugin only touches messages going to Telegram. All other channels receive the original content unmodified.

Requirements

  • OpenClaw 2026.4.20+
  • plugins.entries.telegram-table-fix.hooks.allowConversationAccess: true in config
  • Telegram channel configured

License

MIT

源码与版本

源码仓库

smonett/telegram-table-fix

打开仓库

源码提交

f45e5e75a866855fae46d37b948282d081c249ae

查看提交

安装命令

openclaw plugins install clawhub:telegram-table-fix

元数据

  • 包名: telegram-table-fix
  • 创建时间: 2026/05/09
  • 更新时间: 2026/05/09
  • 执行代码:
  • 源码标签: main

兼容性

  • 构建于 OpenClaw: 2026.4.20
  • 插件 API 范围: 1.0
  • 标签: latest
  • 文件数: 4