← Back to library

Telegram 消息防卡片刷屏:用 disableWebPagePreview 关闭链接预览

问题:运营通知里 URL 很多时,Telegram 自动预览会把消息撑得很长。做法:在 message send 中显式关闭网页预览,保留可点击链接但不生成卡片。

GITHUBDiscovered 2026-02-18Author @shelomentsevtsev
Prerequisites
  • Telegram channel is connected and OpenClaw message tool can send to target chat/topic.
  • Gateway/CLI version includes PR #19869 or later release.
Steps
  1. Pick one link-heavy notification template and keep message body unchanged for A/B comparison.
  2. Send baseline message with default preview behavior and record final rendered height/noise in chat.
  3. Send the same text with preview disabled (`disableWebPagePreview=true`).
  4. Apply this option to broadcast/cron templates where concise delivery is preferred.
Commands
openclaw gateway status
openclaw gateway restart
openclaw message send --channel telegram --target <chat_id> --message 'Links: https://a.com https://b.com' --disable-web-page-preview
Verify

Messages still contain clickable URLs but no webpage card preview is rendered in Telegram.

Caveats
  • CLI/SDK flag naming can vary by release; confirm final parameter name in your installed version(需验证).
  • For campaigns that rely on rich cards to improve CTR, disabling preview may reduce engagement.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post