claude-code - 💡(How to fix) Fix Telegram plugin: add disable_link_preview parameter to reply tool [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46379Fetched 2026-04-11 06:21:50
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

The official Telegram plugin's reply tool doesn't expose Telegram's link_preview_options parameter. For link-heavy messages (news briefings, research digests, etc.), Telegram renders large preview cards for the first URL, which breaks mobile layout and makes messages much wider than intended.

Root Cause

The official Telegram plugin's reply tool doesn't expose Telegram's link_preview_options parameter. For link-heavy messages (news briefings, research digests, etc.), Telegram renders large preview cards for the first URL, which breaks mobile layout and makes messages much wider than intended.

Fix Action

Fix / Workaround

The Telegram Bot API supports link_preview_options natively. This is a one-line change in the tool schema + one line in the handler. I've patched it locally in my cached copy but it gets overwritten on plugin updates.

Code Example

disable_link_preview: {
  type: 'boolean',
  description: 'Disable link preview cards in the message. Default: false.',
},

---

const disableLinkPreview = Boolean(args.disable_link_preview)
// ... in sendMessage options:
...(disableLinkPreview ? { link_preview_options: { is_disabled: true } } : {}),
RAW_BUFFERClick to expand / collapse

Summary

The official Telegram plugin's reply tool doesn't expose Telegram's link_preview_options parameter. For link-heavy messages (news briefings, research digests, etc.), Telegram renders large preview cards for the first URL, which breaks mobile layout and makes messages much wider than intended.

Current behavior

The reply tool passes text and optional parse_mode to bot.api.sendMessage() but doesn't support disabling link previews. Messages with URLs get automatic preview cards.

Requested behavior

Add an optional disable_link_preview boolean parameter to the reply tool schema. When true, pass link_preview_options: { is_disabled: true } to bot.api.sendMessage().

Context

The Telegram Bot API supports link_preview_options natively. This is a one-line change in the tool schema + one line in the handler. I've patched it locally in my cached copy but it gets overwritten on plugin updates.

Suggested implementation

In server.ts, reply tool schema:

disable_link_preview: {
  type: 'boolean',
  description: 'Disable link preview cards in the message. Default: false.',
},

In the reply handler:

const disableLinkPreview = Boolean(args.disable_link_preview)
// ... in sendMessage options:
...(disableLinkPreview ? { link_preview_options: { is_disabled: true } } : {}),

extent analysis

TL;DR

To fix the issue with link previews in the Telegram plugin's reply tool, add a disable_link_preview boolean parameter to the tool schema and pass link_preview_options to bot.api.sendMessage() when the parameter is true.

Guidance

  • Modify the reply tool schema in server.ts to include a disable_link_preview boolean parameter.
  • Update the reply handler to check the disable_link_preview parameter and pass link_preview_options to bot.api.sendMessage() accordingly.
  • Verify the fix by sending a message with a URL and checking if the link preview card is disabled when disable_link_preview is true.
  • Consider patching the local cached copy of the plugin with the suggested implementation until an official update is available.

Example

// In server.ts, reply tool schema:
disable_link_preview: {
  type: 'boolean',
  description: 'Disable link preview cards in the message. Default: false.',
},

// In the reply handler:
const disableLinkPreview = Boolean(args.disable_link_preview)
// ... in sendMessage options:
...(disableLinkPreview ? { link_preview_options: { is_disabled: true } } : {}),

Notes

The suggested implementation is a one-line change in the tool schema and one line in the handler, making it a relatively simple fix.

Recommendation

Apply the workaround by patching the local cached copy of the plugin with the suggested implementation, as it is a simple and effective solution to disable link previews in the reply tool.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING