Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺŸ OpenClaw Telegram Tables Patch

Fix Telegram rich message tables to render with visible vertical column borders by sending raw Markdown instead of HTML through Bot API 10.1 sendRichMessage.

OpenClaw Platform Bot API License

πŸ“‹ Problem

OpenClaw converts Markdown tables to HTML internally before sending them via Telegram's sendRichMessage API as {html: "<table>..."}. However, Telegram's rich HTML renderer does not display vertical column borders on tables, making them look like plain text without visual separation between columns.

βœ… Solution

This patch modifies OpenClaw's Telegram sending pipeline to send raw Markdown as {markdown: "..."} instead of converting to HTML. Telegram's Bot API 10.1 natively converts Markdown tables to RichBlockTable blocks with proper borders, alignment, and formatting β€” just like Telegram's own table rendering.

What Changed

Two functions in OpenClaw's send-*.js (in dist/) are patched:

Function Before After
buildTelegramRichMarkdown Converts Markdown β†’ HTML β†’ sends {html} Sends {markdown} directly
splitTelegramRichMessageTextChunks Converts chunks to HTML Passes Markdown chunks as-is

πŸš€ Installation

From GitHub (recommended)

openclaw skills install git:https://github.com/basil20100/openclaw-telegram-tables-patch

From Local Directory

openclaw skills install ./openclaw-telegram-tables-patch

πŸ“– Usage

Step 1: Enable Rich Messages (one-time)

openclaw config patch --stdin <<'json'
{"channels": {"telegram": {"richMessages": true}}}
json

Step 2: Apply the Patch

node ~/.openclaw/workspace/skills/openclaw-telegram-tables-patch/scripts/telegram-rich-markdown.patch.js

Step 3: Restart the Gateway

systemctl --user restart openclaw-gateway

Step 4: Verify

Send a Markdown table in Telegram β€” you should see vertical column borders.

| Feature | Status | Details |
|--------|--------|---------|
| Tables | βœ… | Working |
| Borders | βœ… | Visible |
| Alignment | βœ… | Centered |

⚠️ Important Notes

  • Re-apply after every OpenClaw update β€” npm update -g openclaw overwrites the patched file
  • The patch script auto-detects OpenClaw's installation path across systems
  • If the patch can't find the target file (e.g., filename changed), it will warn you β€” manual patching may be needed
  • A backup of the original file is saved as send-*.js.bak

πŸ”§ How It Works

Before (broken):
  Markdown table β†’ markdownToTelegramRichHtml() β†’ HTML <table> β†’ sendRichMessage({html}) β†’ ❌ no borders

After (fixed):
  Markdown table β†’ sendRichMessage({markdown}) β†’ Telegram renders RichBlockTable β†’ βœ… borders

πŸ§ͺ Tested On

  • OpenClaw 2026.6.11 (e085fa1)
  • Telegram Bot API 10.1
  • Node.js v22+
  • Linux (systemd)

πŸ“„ License

MIT β€” free to use, modify, and distribute.

🀝 Contributing

If OpenClaw updates and the patch breaks, please open an issue with the new send-*.js filename and the relevant code section.

πŸ™ Credits

  • Discovered by Basil Albishri while comparing OpenClaw's table rendering with Hermes Agent's approach
  • Hermes sends {markdown} natively β€” this patch brings the same behavior to OpenClaw

About

πŸͺŸ Fix Telegram rich message tables to render with visible vertical column borders by sending raw Markdown instead of HTML

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages