'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?
Solution 1:[1]
Use one *
instead of two as detailed in the official documentation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | CallMeStag |