Search code examples
telegramtelegram-bot

How to make italic underline text in telegram using bot api, with link inside?


I'm writing my own bot using Telegram Bot API and C#.

I want to know, how to make at same time text italic and underline and also pass some hyperlink inside any word in this formatted text?

enter image description here

I want to make a message like on the screenshot presented above.


Solution

  • You should use MarkdownV2 as the sendMessage parse_mode, then you can

    1. Create italic text using _some text_
    2. Create a hyperlink using [some text](https://google.com)
    3. Create underlined text using __some text__

    Combining those:

    _Some italic text with a __[hyperlink](https://google.com)___
    

    Will send a message like:

    enter image description here