It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
ReloadWhen turned on automatically changes
the theme color on reload.
When turned on automatically changes
the theme color every 5 sec.
In Pyrogram, callback queries allow your bot to respond to button clicks without sending a new message. Instead, it edits the existing message. This tutorial will guide you on how to set up callback buttons in Pyrogram.
Follow the below steps to add inline keyboard buttons in Pyrogram.
1. Create your Script file for responses.
class text(object): START = """your_start_message""" ABOUT = """📜 Check About: Library: Pyrogram 📚 Language: Python 🐍 Server: Koyeb 🌐 Build Status: V1.3 🚀 Source Code: Available (Free) 💻""" HELP = """your_help_text"""
2. Create a new file name "callback.py" and paste the following code
from pyrogram import Client from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup from Script import text @Client.on_callback_query() async def callback_query_handler(client, query: CallbackQuery): if query.data == "start": await query.message.edit_text( text.START.format(query.from_user.mention), disable_web_page_preview=True, reply_markup=InlineKeyboardMarkup([ [InlineKeyboardButton("About", callback_data="about"), InlineKeyboardButton("Help", callback_data="help")], [InlineKeyboardButton("Developer", url="https://telegram.me/TechifyRahul")] ]) ) elif query.data == "help": await query.message.edit_text( text.HELP, disable_web_page_preview=True, reply_markup=InlineKeyboardMarkup([ [InlineKeyboardButton("Updates", url="https://telegram.me/Techifybots"), InlineKeyboardButton("Support", url="https://telegram.me/TechifySupport")], [InlineKeyboardButton("Back", callback_data="start"), InlineKeyboardButton("Close", callback_data="close")] ]) ) elif query.data == "about": await query.message.edit_text( text.ABOUT, disable_web_page_preview=True, reply_markup=InlineKeyboardMarkup([ [InlineKeyboardButton("💥 Repo", url="https://github.com/TechifyBots/AI-Bot"), InlineKeyboardButton("👨💻 Owner", url="https://telegram.me/TechifyRahul")], [InlineKeyboardButton("Back", callback_data="start"), InlineKeyboardButton("Close", callback_data="close")] ]) ) elif query.data == "close": await query.message.delete()
Note:You can add or remove data according to your needs.
Copying the post and using it without permission is strictly prohibited.