Alessandro Ceccarelli
Alessandro Ceccarelli

Reputation: 1945

Send Telegram bot messages with formatted text

I am sending Telegram bot messages in the following way:

bot_message = "Hi **James**, how are you doing?"

send_text = f"https://api.telegram.org/bot{bot_token}/sendMessage?chat_id={chat_id}&parse_mode=Markdown&text={bot_message}"

response = requests.get(send_text)

However, it seems like I'm not able to correctly format bold content within the message; how can I do that?

Upvotes: 2

Views: 8935

Answers (1)

CallMeStag
CallMeStag

Reputation: 7050

Use one * instead of two as detailed in the official documentation.

Upvotes: 1

Related Questions