Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Telegram: parse_mode missing for media captions #1478

@evgyur

Description

@evgyur

Bug

When sending a message with media (image/video/audio) via the message tool, the caption text is sent without parse_mode, so markdown formatting is not rendered.

Expected

Caption should support markdown formatting like regular text messages.

Actual

Caption is sent as plain text. Asterisks show literally instead of bold.

Location

dist/telegram/send.js - mediaParams object is missing:

  • parse_mode: 'HTML'
  • Caption should be converted via markdownToTelegramHtml(caption)

Comparison

Text-only messages correctly use:

const textParams = {
    parse_mode: 'HTML',
    ...
};
const htmlText = markdownToTelegramHtml(text);

But media messages use:

const mediaParams = {
    caption,  // raw text, no conversion
    // no parse_mode
};

Fix

Add parse_mode: 'HTML' to mediaParams and convert caption with markdownToTelegramHtml().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions