Skip to content

Add --no-preview flag to send text #10

Description

@dapi

Problem

When sending messages with inline links via tgcli send text --parse-mode markdown, Telegram generates a link preview (URL embed) automatically. There is no way to disable this.

Proposed solution

Add --no-preview boolean flag to send text command to disable automatic link preview.

tgcli send text --to <id> --message "Check [this](https://example.com)" --parse-mode markdown --no-preview

MTProto mapping: messages.sendMessagenoWebpage: true

Note: send file with caption can also contain links, but Telegram does not generate link previews for media messages — only for plain text. So --no-preview applies to send text only.

Implementation plan

  1. cli.js: add --no-preview boolean option to send text command
  2. telegram-client.jssendTextMessage(): pass noWebpage: true in params when flag is set
  3. mcp-server.js: add no_preview boolean parameter to sendMessage MCP tool
  4. docs/cli.md: document the new flag
  5. SKILL.md: update Send Text section with --no-preview examples

gramjs verification: confirm that client.sendText(peer, text, { noWebpage: true }) is supported — check gramjs sendMessage params interface.

Context

Telegram MTProto API supports noWebpage parameter in messages.sendMessage. This is especially useful for digest-style posts with multiple links where preview clutters the message.

See also: #11 (other missing send parameters: --silent, --no-forwards, --caption-above, --spoiler, --schedule, --force-document)

Current workaround

Use telegram-mcp send_message with disable_web_page_preview: true, but this breaks the workflow when everything else is done via tgcli.

Acceptance criteria

  • tgcli send text --no-preview sends message with noWebpage: true
  • MCP sendMessage tool accepts no_preview parameter
  • Documented in docs/cli.md
  • SKILL.md updated (Send Text section with --no-preview example)
  • Smoke tested: message with link sent without preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions