Telegram send message with clickable bot command

Viewed 4940

I'm writing a bot in telegram (using c#).

I want the bot to send message to a user with a list of clickable links. When user presses such a link, the client should post this command back to the bot. It should look like this (example from @pollbot): enter image description here

I tried:

  1. sendMesage method with parse_mode=HTML and tg:\ links. Problem: telegram renders them as unsafe and navigates away from the chat. Or shows no link.

    /sendMessage?chat_id=xxxxxxxx&parse_mode=HTML&text=<a href="\Command">CommandText</a>
    

    etc...

  2. sendMessage with markdown - same result or no link

    /sendMessage?chat_id=xxxxxxxxx&parse_mode=markdown&text=[\CommandText](\Command)
    
  3. inline keyboard works OK, but I need a link, not a button

Any advice on how to implement this is higly appreciated.

1 Answers

Words starting with a "/" in a text are automatically made clickable as a link. You can just use sendMessage without a parse_mode and send the text /newpoll.

Related