How to make click button in telegram

Viewed 39

I want to make a link button in Telegram browser, how should I a path follow e.g

The output i got

The output i want to get

token="xxx"
url=f"https://api.telegram.org/bot{token}/sendMessage"
data={"chat_id": f"{chat_id}","text":f"""
Konum: https://maps.google.com/?q=37.335637,40.705739&ll=37.335637,40.705739&z=8
"""}
requests.post(url,data).json()

I hope I explained, thanks in advance

1 Answers

Enter the link like this

data={
    "chat_id": f"{chat_id}",
    "text":f" Konum: <a href=\"https://maps.google.com/?q=37.335637,40.705739&ll=37.335637,40.705739&z=8\">link</a>",
    "parse_mode": "html"
}

you can also use markdown as

data = {
        "chat_id":chat_id, 
        "text":f"Konum: [link](https://maps.google.com/?q=37.335637,40.705739&ll=37.335637,40.705739&z=8)",
        "parse_mode": "markdown",
    }
Related