How to open URL's using telegraf JS markup inline keyboard in telegram in app browser?

5.5k Views Asked by At

Code Snippet:

ctx.reply(
    `Hi! ${ctx.from.first_name}  \n \n Shall we start?  `,
    Markup.inlineKeyboard(
      [
  
        Markup.button.url(
          "Covid-19  IN",
          "https://www.covid19india.org/"
        ),
        Markup.button.url("WHO ", "https://covid19.who.int/"),
       

      ],
      { columns: 2 }
    )
  );

This is throwing a 400 Bad request URL exception.

Any help, how to open these URL's in telegram inline browser ?

2

There are 2 best solutions below

0
On
ctx.replyWithHTML(texts, Markup.inlineKeyboard([
                  [Markup.button.url(linktext,url)]
             ]))
2
On
 Markup.urlButton("NAME", "https://url.com/"),