randydev's picture
fix try
7ef6cc2
raw
history blame
2.35 kB
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
)