|
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 |
|
) |