Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telegram API "parseMode:MarkdownV2" doesn't change text style

so I try to use Telegram's API to send messages to a group. Sending messages is working, but when I try to send messages with a certain style, for example bold, it just doesn't work.

My example message is: "* hello send help *". It should look something like this: hello send help, but it just sends the literal (i.e the * shows in the message and it is not bold)

here's the code: `

payload = {"parseMode": "MarkdownV2", "chat_id": chat_id, "text": "*Send help*"}
requests.post(f"https://api.telegram.org/bot{bot_token}/sendMessage", data=payload)

When trying to use parse_mode instead parseMode I just get error 400. What do I do wrong? I also tried to use "HTML" as parseMode but it still doesn`t work


1 Answers

The parameter of sendMessage is specified as parse_mode, not parseMode. Try that.

like image 52
CallMeStag Avatar answered Mar 06 '26 07:03

CallMeStag



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!