← Back to library

Telegram 原图发送:通过 mediaOptimize=false 避免图片被压缩

问题/场景:默认 Telegram 图片通道会压缩,海报/设计稿细节丢失。前置条件:已接入 Telegram channel 且可修改 OpenClaw 配置。实施步骤:在 channels.telegram 里关闭 mediaOptimize,重启 gateway,并用同一张高分辨率图做前后对照发送。关键命令/配置:`"mediaOptimize": false`、`openclaw gateway restart`。验证:接收端显示为文档附件(非压缩照片)且像素/体积保持原始级别。风险与边界:文件型发送会降低预览体验,默认行为未变(默认仍压缩)。来源:PR #22434 + Telegram Bot API sendDocument/sendPhoto 行为说明。

GITHUBDiscovered 2026-02-22Author godenjan
Prerequisites
  • OpenClaw Telegram channel is already configured and working for outbound media.
  • You can edit OpenClaw config and restart gateway service.
Steps
  1. Open your OpenClaw config and locate `channels.telegram` account settings.
  2. Set `mediaOptimize` to `false` for the target Telegram account.
  3. Restart gateway so new outbound adapter config is loaded.
  4. Send one test image and compare output type/quality with previous behavior.
Commands
openclaw gateway restart
openclaw gateway status
# config snippet: "channels": { "telegram": { "mediaOptimize": false } }
Verify

Telegram recipient sees image delivered as file/document (not recompressed photo), and visual details remain intact.

Caveats
  • Document-style delivery may reduce in-chat preview convenience compared with photo mode.
  • Type updates around this option were still being iterated in PR review; validate on your running version(需验证).
Source attribution

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

Open original source ↗
Visit original post