from pyrogram import filters, Client from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton help_texts = { "ban": "**Ban Commands:**\n" "/ban - Ban a user\n" "/unban - Unban a user\n" "/tban - Temporary ban\n" "/banme - Ban yourself", "mute": "**Mute Commands:**\n" "/mute - Mute a user\n" "/unmute - Unmute user\n" "/tmute - Temporary mute\n" "/muteme - Mute yourself", "promote": "**Promotion Commands:**\n" "/promote - Promote user\n" "/demote - Demote user\n" "/title - Set admin title\n" "/adminlist - List admins", "clean": "**Cleaning Commands:**\n" "/del - Delete message\n" "/purge - Purge messages\n" "/delall - Delete all messages\n" "/setgpic - Set group photo", "lock": "**Locking Commands:**\n" "/lock - Lock permissions\n" "/unlock - Unlock permissions\n" "/locks - Current locks\n" "/locktypes - Available locks" } @Client.on_callback_query(filters.regex("^rhelp_")) async def rxhelp_callback(client, callback): category = callback.data.split("_")[1] keyboard = InlineKeyboardMarkup([ [InlineKeyboardButton("๐Ÿ”™ Back", callback_data="rhelp_back")] ]) await callback.edit_message_text( help_texts.get(category, "Invalid help category!"), reply_markup=keyboard ) @Client.on_callback_query(filters.regex("^rhelp_back")) async def rhelp_back(client, callback): keyboard = InlineKeyboardMarkup([ [ InlineKeyboardButton("๐Ÿšซ Ban", callback_data="rhelp_ban"), InlineKeyboardButton("๐Ÿ”‡ Mute", callback_data="rhelp_mute") ], [ InlineKeyboardButton("๐Ÿ‘‘ Promote", callback_data="rhelp_promote"), InlineKeyboardButton("๐Ÿ›ก๏ธ Demote", callback_data="rhelp_demote") ], [ InlineKeyboardButton("๐Ÿงน Clean", callback_data="rhelp_clean"), InlineKeyboardButton("๐Ÿ”’ Lock", callback_data="rhelp_lock") ] ]) await callback.edit_message_text( "**Admin Help Menu**\nChoose a category:", reply_markup=keyboard )