windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
264 stars 117 forks source link

parse_mode MarkdownV2 can't parse entities #301

Closed iamkarlson closed 1 year ago

iamkarlson commented 1 year ago

Similarly to #128 I'm getting the following error:

ETELEGRAM: 400 Bad Request: can't parse entities: Character '-' is reserved and must be escaped with the preceding '\'

image

{
    "payload": {
        "type": "message",
        "chatId": "10______",
        "options": {
            "parse_mode": "MarkdownV2"
        },
        "content": "*bold \\*text* \n_italic \\*text_\n__underline__\n~strikethrough~\n*bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*\n[inline URL](http://www.example.com/)\n[inline mention of a user](tg://user?id=123456789)\ninline fixed-width code\n```\npre-formatted fixed-width code block\n```\n```python\npre-formatted fixed-width code block written in the Python programming language\n```"
    },
    "_msgid": "40ad______b68"
}

image

Not sure if it must be configured anyhow but that doesn't occur when parse_mode not set.

windkh commented 1 year ago

The error comes directly from the TG server. I can not do anything about it. Sorry

iamkarlson commented 1 year ago

rtfm, should be used just "Markdown"