Spaces:
Running
Running
| from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup) | |
| from pyrogram import Client , filters | |
| from script import * | |
| from config import * | |
| 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) | |
| 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) | |
| 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) | |
| 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) | |
| 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) | |
| 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) | |
| 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)) | |
| 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")]]) | |
| ) | |