I want to send a Telegram message using the native Python requests so that the "First Name" is received in using in BOLD. I have tried HTML and Markdown syntax but it's not showing.
import json
import requests
# Telegram bot configurations
TELE_TOKEN='TOKEN'
URL = "https://api.telegram.org/bot{}/".format(TELE_TOKEN)
def send_message(text, chat_id):
url = URL + "sendMessage?text={}&chat_id={}".format(text, chat_id)
requests.get(url)
# AWS Lambda handler
def lambda_handler(event, context):
message = json.loads(event['body'])
chat_id = message['message']['chat']['id']
first_name = message['message']['chat']['first_name']
text = message['message']['text']
# How can the first name be in BOLD?
reply = "Hello " + first_name + "! You have said:" + text
send_message(reply, chat_id)
return {
'statusCode': 200
}