Skip to content Skip to sidebar Skip to footer

How To Add Url To Inlinekeyboardbutton For Telegram Bot

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_te

Solution 1:

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')],
    ])
)

Post a Comment for "How To Add Url To Inlinekeyboardbutton For Telegram Bot"