Please Subscribe To My YouTube Channel Subscribe Now!

How to add Inline Buttons in Pyrogram

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

Pyrogram Inline Keyboard Buttons

Inline keyboard buttons allow you to add interactive buttons to your Telegram bot. These buttons can open links, send callbacks, or trigger specific actions when clicked.

Follow the below steps to add inline keyboard buttons in Pyrogram.

1. You have to import buttons from Python.

from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton

2. Add a single button in one row.

reply_markup = InlineKeyboardMarkup([
    [InlineKeyboardButton("Example 1", url="http://telegram.me/TechifyBots")]
])

3. Add multiple buttons in one row.

reply_markup = InlineKeyboardMarkup([
    [InlineKeyboardButton("Example 1", url="http://t.me/TechifyBots"),
     InlineKeyboardButton("Example 2", url="http://t.me/TechifyBots"),
     InlineKeyboardButton("Example 3", url="http://t.me/TechifyBots")]
])

4. Add multiple buttons in multiple rows.

reply_markup = InlineKeyboardMarkup([
    [InlineKeyboardButton("Example 1", url="http://t.me/TechifyBots"),
     InlineKeyboardButton("Example 2", url="http://t.me/TechifyBots")],
    [InlineKeyboardButton("Example 3", url="http://t.me/TechifyBots"),
     InlineKeyboardButton("Example 4", url="http://t.me/TechifyBots")]
])

5. Add buttons in different row structures.

reply_markup = InlineKeyboardMarkup([
    [InlineKeyboardButton("Example 1", url="http://t.me/TechifyBots")],
    [InlineKeyboardButton("Example 2", url="http://t.me/TechifyBots"),
     InlineKeyboardButton("Example 3", url="http://t.me/TechifyBots")],
    [InlineKeyboardButton("Example 4", url="http://t.me/TechifyBots")]
])
Important

If you still face any issues, then click on the below button.

Copying the post and using it without permission is strictly prohibited.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.