File size: 4,785 Bytes
325be9d
 
 
 
 
 
 
 
 
 
 
 
 
20383d1
325be9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20383d1
 
ef51582
325be9d
 
 
 
 
 
 
 
 
 
 
 
 
dc7e7fa
325be9d
 
 
 
 
 
 
 
 
20fc8f6
3c77ad9
 
20fc8f6
3c77ad9
20fc8f6
e15fdbc
20fc8f6
3c77ad9
 
 
 
dc7e7fa
3c77ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325be9d
 
 
 
 
 
 
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup)
from pyrogram import Client , filters
from script import *
from config import *





@Client.on_callback_query(filters.regex('about'))
async def about(bot,update):
    text = script.ABOUT_TXT.format(bot.me.mention)
    keybord = InlineKeyboardMarkup([  
                    [InlineKeyboardButton("Back", callback_data="home", icon_custom_emoji_id=5433653135799228968)]
                  ])
    await update.message.edit(text = text,reply_markup = keybord)



@Client.on_message(filters.private & filters.command(["donate"]))
async def donatecm(bot,message):
    text = script.DONATE_TXT
    keybord = InlineKeyboardMarkup([
        [InlineKeyboardButton("πŸ¦‹ Admin",url = "https://t.me/CallAdminRobot"),
        InlineKeyboardButton("βœ–οΈ Close",callback_data = "cancel") ]])
    await message.reply_text(text = text,reply_markup = keybord)    



@Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["admin"]))
async def admincm(bot,message):
    text = script.ADMIN_TXT
    keybord = InlineKeyboardMarkup([
        [InlineKeyboardButton("βœ–οΈ Close βœ–οΈ",callback_data = "cancel") ]])
    await message.reply_text(text = text,reply_markup = keybord)    



@Client.on_callback_query(filters.regex('help'))
async def help(bot,update):
    text = script.HELP_TXT.format(update.from_user.mention)
    keybord = InlineKeyboardMarkup([ 
                    [InlineKeyboardButton('Thumbnail', callback_data='thumbnail', icon_custom_emoji_id=5375074927252621134),
                    InlineKeyboardButton('Caption', callback_data='caption', icon_custom_emoji_id=5316994101688677895)],
                    [InlineKeyboardButton('Home', callback_data='home', icon_custom_emoji_id=5433653135799228968)]
                   ])
    await update.message.edit(text = text,reply_markup = keybord)



@Client.on_callback_query(filters.regex('thumbnail'))
async def thumbnail(bot,update):
    text = script.THUMBNAIL_TXT
    keybord = InlineKeyboardMarkup([  
                    [InlineKeyboardButton("πŸ”™ Back",callback_data = "help")]
		  ])
    await update.message.edit(text = text,reply_markup = keybord)

@Client.on_callback_query(filters.regex('^caption$'))
async def caption(bot,update):
    text = script.CAPTION_TXT
    keybord = InlineKeyboardMarkup([  
                    [InlineKeyboardButton("πŸ”™ Back",callback_data = "help")]
		  ])
    await update.message.edit(text = text,reply_markup = keybord)

@Client.on_callback_query(filters.regex('home'))
async def home_callback_handler(bot, query):
    text = f"""<emoji id="5316994101688677895">πŸ’Œ</emoji> <b>Welcome back, {query.from_user.mention}!</b>\n\n<emoji id="5985386442824619877">πŸš€</emoji> <i>Experience the next level of <b>Auto Renaming</b> with unmatched speed and precision.</i>\n\n<b><emoji id="5433653135799228968">πŸ“</emoji> High-End Features:</b>\n   β€’ <b>Renaming</b> with custom metadata.\n   β€’ <b>Thumbnail</b> management with ease.\n   β€’ <b>Convert</b> between Files and Videos.\n   β€’ <b>Fast</b> & Secure processing.\n\n<emoji id="5377834924776627189">⚑️</emoji> <i>Built for efficiency, designed for you.</i>\n\n<b>Bot Managed By @dragbotsupport</b>"""
    buttons = [  
        [InlineKeyboardButton("Updates", url="https://t.me/dragbots", icon_custom_emoji_id=5985386442824619877),
        InlineKeyboardButton("Support", url="https://t.me/dragbotsupport", icon_custom_emoji_id=5377834924776627189)],
        [InlineKeyboardButton("Help", callback_data='help', icon_custom_emoji_id=5375074927252621134),
        InlineKeyboardButton("About", callback_data='about', icon_custom_emoji_id=5224607267797606837)],
        [InlineKeyboardButton("Stats", callback_data="stats", icon_custom_emoji_id=5042290883949495533)],
        [InlineKeyboardButton("Developer", url="https://t.me/lungiiman", icon_custom_emoji_id=5985386442824619877)]
    ]
    
    await query.message.edit_text(text=text, reply_markup=InlineKeyboardMarkup(buttons))

@Client.on_callback_query(filters.regex("^stats$"))
async def stats_callback_handler(bot, query):
    from helper.database import botdata, find_one, total_user
    from helper.progress import humanbytes
    token = BOT_TOKEN
    botid = token.split(':')[0]
    botdata(int(botid))
    data = find_one(int(botid))
    total_rename = data["total_rename"]
    total_size = data["total_size"]
    
    stats_text = f"""<b>⚑️ Total User :</b> {total_user()}\n\n<b>⚑️ Total Renamed File :</b> {total_rename}\n<b>⚑ Total Size Renamed :</b> {humanbytes(int(total_size))}"""
    
    await query.message.edit_text(
        text=stats_text,
        reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("πŸ”™ Back", callback_data="home")]])
    )