4

I would like to make the button that will open URL (external hyperlink) in browser from Telegram chat. Currently, I developed only clickable action buttons.

update.message.reply_text(
    'Subscribe to us on Facebook and Telegram:',
    reply_markup=InlineKeyboardMarkup([
        [InlineKeyboardButton(text='on Facebook', callback_data='Facebook')],
        [InlineKeyboardButton(text='on Telegram', callback_data='Telegram')],
    ])
)

But how to make them as link (with arrow). I want to ask for users for sharing.

wowkin2
  • 5,895
  • 5
  • 23
  • 66

1 Answers1

7

Instead of callback_data argument you can use url and that's it.

update.message.reply_text(
    'Subscribe to us on Facebook and Telegram:',
    reply_markup=InlineKeyboardMarkup([
        [InlineKeyboardButton(text='on Facebook', url='https://facebook.com')],
        [InlineKeyboardButton(text='on Telegram', url='https://t.me')],
    ])
)
wowkin2
  • 5,895
  • 5
  • 23
  • 66