File size: 2,350 Bytes
7ef6cc2
 
1594ae8
7ef6cc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1594ae8
7ef6cc2
 
 
 
 
 
 
 
 
 
1594ae8
 
7ef6cc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
    )