├── plugins ├── Mods │ └── test ├── __init__.py ├── restart.py ├── refer.py ├── adminc.py ├── lazyusers.py ├── thumbfunction.py ├── broadcast.py ├── thumbset.py ├── settings.py ├── caption.py ├── gold.py ├── silver.py ├── diamond.py ├── thaption.py ├── kingmsaa.py ├── upgrade.py ├── myplane.py ├── help.py ├── filedetect.py ├── admin.py ├── start.py └── cb_data.py ├── runtime.txt ├── Procfile ├── koyeb.yml ├── Dockerfile ├── requirements.txt ├── app.py ├── docker-compose.yml ├── route.py ├── render.yaml ├── helper ├── date.py ├── set.py ├── uploadbot.py ├── progress.py ├── ffmpeg.py └── database.py ├── bot.py ├── logging.conf ├── config.py ├── LICENSE ├── app.json └── README.md /plugins/Mods/test: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.8 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: python3 bot.py 2 | -------------------------------------------------------------------------------- /koyeb.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | web: Dockerfile 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10 2 | WORKDIR /app 3 | COPY . /app/ 4 | RUN pip install -r requirements.txt 5 | CMD ["python", "bot.py"] 6 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow 2 | humanize 3 | hachoir 4 | pyrogram 5 | TgCrypto 6 | pymongo==4.5.0 7 | dnspython 8 | Flask 9 | gunicorn 10 | telethon 11 | aiohttp 12 | mongo 13 | -------------------------------------------------------------------------------- /plugins/__init__.py: -------------------------------------------------------------------------------- 1 | from aiohttp import web 2 | from route import routes 3 | 4 | async def web_server(): 5 | web_app = web.Application(client_max_size=30000000) 6 | web_app.add_routes(routes) 7 | return web_app 8 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | #Thank you LazyDeveloper for helping me in this journey ! 2 | #Must Subscribe On YouTube @LazyDeveloperr 3 | 4 | from flask import Flask 5 | app = Flask(__name__) 6 | 7 | @app.route('/') 8 | def hello_world(): 9 | return '@LazyDeveloper' 10 | 11 | 12 | if __name__ == "__main__": 13 | app.run() 14 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | workerdisk: 4 | build: . 5 | environment: 6 | - API_ID=${API_ID} 7 | - API_HASH=${HASH} 8 | - TOKEN=${TOKEN} 9 | - DB_NAME=${DB_NAME} 10 | - DB_URL=${DB_URL} 11 | - CHANNEL=${CHANNEL} 12 | - ADMIN=${ADMIN} 13 | - LAZY_PIC=${LAZY_PIC} 14 | -------------------------------------------------------------------------------- /route.py: -------------------------------------------------------------------------------- 1 | from aiohttp import web 2 | 3 | routes = web.RouteTableDef() 4 | 5 | @routes.get("/", allow_head=True) 6 | async def root_route_handler(request): 7 | return web.json_response("PyʀᴏBᴏᴛᴢ") 8 | 9 | 10 | async def web_server(): 11 | web_app = web.Application(client_max_size=30000000) 12 | web_app.add_routes(routes) 13 | return web_app 14 | -------------------------------------------------------------------------------- /render.yaml: -------------------------------------------------------------------------------- 1 | # A Docker web service 2 | - type: web 3 | name: fffgeedwtgg 4 | env: python 5 | startCommand: python3 bot.py 6 | buildCommand: pip3 install -U -r requirements.txt 7 | repo: https://github.com/Maheshbot99/fffgeedwtgg.git # optional 8 | region: oregon # optional (defaults to oregon) 9 | plan: free # optional (defaults to starter) 10 | branch: main # optional (defaults to master) 11 | numInstances: 1 # optional (defaults to 1) 12 | healthCheckPath: / 13 | 14 | #End of yaml 15 | -------------------------------------------------------------------------------- /plugins/restart.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pyrogram import Client, filters 3 | from helper.database import botdata, find_one, total_user 4 | from config import * 5 | from helper.progress import humanbytes 6 | 7 | botid = TOKEN_ONE.split(':')[0] 8 | 9 | @Client.on_message(filters.private & filters.command(["restart"])) 10 | async def start(client,message): 11 | botdata(int(botid)) 12 | data = find_one(int(botid)) 13 | total_rename = data["total_rename"] 14 | total_size = data["total_size"] 15 | await message.reply_text(f"**⌾ ʙᴏᴛ ɪꜱ ʀᴇꜱᴛᴀʀᴛᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy**",quote=True) 16 | -------------------------------------------------------------------------------- /helper/date.py: -------------------------------------------------------------------------------- 1 | from datetime import timedelta, date ,datetime 2 | import time 3 | 4 | def add_date(): 5 | today = date.today() 6 | ex_date = today + timedelta(days=30) 7 | pattern = '%Y-%m-%d' 8 | epcho = int(time.mktime(time.strptime(str(ex_date), pattern))) 9 | normal_date = datetime.fromtimestamp(epcho).strftime('%Y-%m-%d') 10 | return epcho , normal_date 11 | 12 | def check_expi(saved_date): 13 | today = date.today() 14 | pattern = '%Y-%m-%d' 15 | epcho = int(time.mktime(time.strptime(str(today), pattern))) 16 | then = saved_date - epcho 17 | print(then) 18 | if then > 0: 19 | return True 20 | else: 21 | return False 22 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from pyrogram import Client, compose,idle 3 | import os 4 | from aiohttp import web 5 | from route import web_server 6 | from config import * 7 | from plugins.cb_data import app as Client2 8 | 9 | bot = Client( 10 | 11 | "Renamerone", 12 | 13 | bot_token=TOKEN_ONE, 14 | 15 | api_id=API_ID, 16 | 17 | api_hash=API_HASH, 18 | 19 | plugins=dict(root='plugins')) 20 | 21 | 22 | if STRING: 23 | apps = [Client2,bot] 24 | for app in apps: 25 | app.start() 26 | idle() 27 | for app in apps: 28 | app.stop() 29 | 30 | else: 31 | bot.run() 32 | 33 | -------------------------------------------------------------------------------- /plugins/refer.py: -------------------------------------------------------------------------------- 1 | from pyrogram import Client, filters 2 | from pyrogram.types import ( InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from config import * 4 | 5 | @Client.on_message(filters.private & filters.command(["refer"])) 6 | async def refer(client,message): 7 | reply_markup = InlineKeyboardMarkup( 8 | [[ InlineKeyboardButton("Share Your Link" ,url=f"https://t.me/share/url?url=https://t.me/{BOT_USERNAME}?start={message.from_user.id}") ] ]) 9 | await message.reply_text(f"Refer And Earn Get 100MB Upload Limit\nPer Refer 100MB\n Your Link :- https://t.me/{BOT_USERNAME}?start={message.from_user.id} ",reply_to_message_id = message.id,reply_markup=reply_markup,) 10 | 11 | -------------------------------------------------------------------------------- /logging.conf: -------------------------------------------------------------------------------- 1 | [loggers] 2 | keys=root 3 | 4 | [handlers] 5 | keys=consoleHandler,fileHandler 6 | 7 | [formatters] 8 | keys=consoleFormatter,fileFormatter 9 | 10 | [logger_root] 11 | level=DEBUG 12 | handlers=consoleHandler,fileHandler 13 | 14 | [handler_consoleHandler] 15 | class=StreamHandler 16 | level=INFO 17 | formatter=consoleFormatter 18 | args=(sys.stdout,) 19 | 20 | [handler_fileHandler] 21 | class=FileHandler 22 | level=ERROR 23 | formatter=fileFormatter 24 | args=('TelegramBot.log','w',) 25 | 26 | [formatter_consoleFormatter] 27 | format=%(asctime)s - %(lineno)d - %(name)s - %(module)s - %(levelname)s - %(message)s 28 | datefmt=%I:%M:%S %p 29 | 30 | [formatter_fileFormatter] 31 | format=[%(asctime)s:%(name)s:%(lineno)d:%(levelname)s] %(message)s 32 | datefmt=%m/%d/%Y %I:%M:%S %p 33 | -------------------------------------------------------------------------------- /plugins/adminc.py: -------------------------------------------------------------------------------- 1 | from pyrogram.types import ( 2 | InlineKeyboardButton, InlineKeyboardMarkup, ForceReply) 3 | import os 4 | from pyrogram import Client, filters 5 | from helper.date import add_date 6 | from helper.database import uploadlimit, usertype, addpre 7 | from config import * 8 | 9 | 10 | @Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["admin"])) 11 | async def buypremium(bot, message): 12 | await message.reply_text("**📚 ᴀᴅᴍɪɴ ᴄᴏᴍᴍᴀɴᴅꜱ : \n➢ /users - ᴛᴏ ᴠɪᴇᴡ ʟɪꜱᴛ ᴏꜰ ᴜꜱᴇʀꜱ \n➢ /broadcast - ᴍᴇꜱꜱᴀɢᴇ ʙʀᴏᴀᴅᴄᴀꜱᴛ \n➢ /ceasepower - ᴛᴏ ᴄᴇᴀꜱᴇ (ᴅᴏᴡɴɢʀᴀᴅᴇ) ʀᴇɴᴀᴍɪɴɢ ᴄᴀᴩᴀᴄɪᴛy \n➢ /resetpower - ᴛᴏ ʀᴇꜱᴇᴛ ʀᴇɴᴀᴍɪɴɢ ᴄᴀᴩᴀᴄɪᴛy \n➢ /addpremium - ᴛᴏ ᴜᴩɢʀᴀᴅᴇ ᴜꜱᴇʀ ᴩʟᴀɴ**", quote=True, reply_markup=InlineKeyboardMarkup([ 13 | [ 14 | InlineKeyboardButton("• ᴄʟᴏꜱᴇ •", callback_data="cancel") 15 | ]])) 16 | 17 | -------------------------------------------------------------------------------- /plugins/lazyusers.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pyrogram import Client, filters 3 | from pyrogram.types import ( InlineKeyboardButton, InlineKeyboardMarkup) 4 | from config import * 5 | from helper.database import botdata, find_one, total_user 6 | from helper.progress import humanbytes 7 | 8 | botid = TOKEN_ONE.split(':')[0] 9 | 10 | @Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["users"])) 11 | async def start(client,message): 12 | botdata(int(botid)) 13 | data = find_one(int(botid)) 14 | total_rename = data["total_rename"] 15 | total_size = data["total_size"] 16 | 17 | 18 | await message.reply_text(f"**⚡️ ᴛᴏᴛᴀʟ ᴜꜱᴇʀꜱ** :- {total_user()}\n\n**⚡️ ᴛᴏᴛᴀʟ ʀᴇɴᴀᴍᴇᴅ ꜰɪʟᴇꜱ**:- {total_rename}\n**⚡ ᴛᴏᴛᴇʟ ʀᴇɴᴀᴍᴇᴅ ꜱɪᴢᴇ** :- {humanbytes(int(total_size))}",quote=True, 19 | reply_markup= InlineKeyboardMarkup([[InlineKeyboardButton("• ᴄʟᴏꜱᴇ ᴍᴇɴᴜ •", callback_data="cancel")]]) 20 | ) 21 | -------------------------------------------------------------------------------- /plugins/thumbfunction.py: -------------------------------------------------------------------------------- 1 | from pyrogram import Client, filters 2 | from helper.database import find, delthumb, addthumb 3 | 4 | @Client.on_message(filters.private & filters.command(['viewthumb'])) 5 | async def viewthumb(client,message): 6 | print(message.chat.id) 7 | thumb = find(int(message.chat.id))[0] 8 | if thumb : 9 | await client.send_photo(message.chat.id,photo =f"{thumb}") 10 | else: 11 | await message.reply_text("**yᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀɴy ᴄᴏꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ !!**") 12 | 13 | 14 | @Client.on_message(filters.private & filters.command(['delthumb'])) 15 | async def removethumb(client,message): 16 | delthumb(int(message.chat.id)) 17 | await message.reply_text("**ᴄᴏꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ ᴅᴇʟᴇᴛᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy !!**") 18 | 19 | @Client.on_message(filters.private & filters.photo) 20 | async def addthumbs(client,message): 21 | file_id = str(message.photo.file_id) 22 | addthumb(message.chat.id , file_id) 23 | await message.reply_text("**ᴄᴏꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ ꜱᴀᴠᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy !!**") 24 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | import re, os 2 | 3 | id_pattern = re.compile(r'^.\d+$') 4 | 5 | API_ID = os.environ.get("API_ID", "") 6 | API_HASH = os.environ.get("API_HASH", "") 7 | #BOT_TOKEN = os.environ.get("BOT_TOKEN", "") 8 | TOKEN_ONE = os.environ.get("TOKEN_ONE", "") 9 | 10 | CHANNEL = os.environ.get("CHANNEL", "ATL_Univers") # username without '@' 11 | BOT_USERNAME = os.environ.get("BOT_USERNAME","") # username without '@' 12 | SUPPORT_GROUP = os.environ.get("SUPPORT_GROUP","BYNF_TamilChat") # username without '@' 13 | UPDATES_CHANNEL = os.environ.get("UPDATES_CHANNEL","ATL_Univers") # username without '@' 14 | OWNER_USERNAME = os.environ.get("OWNER_USERNAME","HMF_Owner_1") 15 | STRING = os.environ.get("STRING", "") 16 | 17 | DB_NAME = os.environ.get("DB_NAME","renameone") 18 | DB_URL = os.environ.get("DB_URL","") 19 | 20 | FLOOD = int(os.environ.get("FLOOD", "90")) 21 | LAZY_PIC = os.environ.get("LAZY_PIC", "") 22 | ADMIN = [int(admin) if id_pattern.search(admin) else admin for admin in os.environ.get('ADMIN', '1989750989').split()] 23 | PORT = os.environ.get('PORT', '8080') 24 | LOG_CHANNEL = int(os.environ.get("LOG_CHANNEL", "-1001230390281")) 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 mr_lokaman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /plugins/broadcast.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pyrogram.errors import FloodWait 3 | import asyncio 4 | from pyrogram import Client, filters 5 | from helper.database import getid, delete 6 | import time 7 | from config import * 8 | 9 | 10 | @Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["broadcast"])) 11 | async def broadcast(bot, message): 12 | if (message.reply_to_message): 13 | ms = await message.reply_text("Geting All ids from database..\n Please wait") 14 | ids = getid() 15 | tot = len(ids) 16 | success = 0 17 | failed = 0 18 | await ms.edit(f"Starting Broadcast... \n Sending Message To {tot} Users") 19 | for id in ids: 20 | try: 21 | time.sleep(1) 22 | await message.reply_to_message.copy(id) 23 | success += 1 24 | except: 25 | failed += 1 26 | delete({"_id": id}) 27 | pass 28 | try: 29 | await ms.edit(f"Message sent to {success} chat(s). {failed} chat(s) failed on receiving message. \nTotal - {tot}") 30 | except FloodWait as e: 31 | await asyncio.sleep(t.x) 32 | -------------------------------------------------------------------------------- /helper/set.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List 2 | def escape_invalid_curly_brackets(text: str, valids: List[str]) -> str: 3 | new_text = "" 4 | idx = 0 5 | while idx < len(text): 6 | if text[idx] == "{": 7 | if idx + 1 < len(text) and text[idx + 1] == "{": 8 | idx += 2 9 | new_text += "{{{{" 10 | continue 11 | else: 12 | success = False 13 | for v in valids: 14 | if text[idx:].startswith('{' + v + '}'): 15 | success = True 16 | break 17 | if success: 18 | new_text += text[idx: idx + len(v) + 2] 19 | idx += len(v) + 2 20 | continue 21 | else: 22 | new_text += "{{" 23 | 24 | elif text[idx] == "}": 25 | if idx + 1 < len(text) and text[idx + 1] == "}": 26 | idx += 2 27 | new_text += "}}}}" 28 | continue 29 | else: 30 | new_text += "}}" 31 | 32 | else: 33 | new_text += text[idx] 34 | idx += 1 35 | 36 | return new_text 37 | -------------------------------------------------------------------------------- /plugins/thumbset.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | 5 | @Client.on_callback_query(filters.regex('kingmahip')) 6 | async def upgrade(bot,update): 7 | text = """ **🖼️ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ** 8 | 9 | **⦿ yᴏᴜ ᴄᴀɴ ᴀᴅᴅ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ ꜱɪᴍᴩʟy ʙy ꜱᴇɴᴅɪɴɢ ᴀ ᴩʜᴏᴛᴏ ᴛᴏ ᴍᴇ....** 10 | 11 | **⦿ /viewthumb - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴛʜᴜᴍʙɴᴀɪʟ** 12 | **⦿ /delthumb - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴀᴍᴍᴏɴᴅ ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴛʜᴜᴍʙɴᴀɪʟ**""" 13 | keybord = InlineKeyboardMarkup([[ 14 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "upgrade")], 15 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "settings") ]]) 16 | await update.message.edit(text = text,reply_markup = keybord) 17 | 18 | 19 | @Client.on_message(filters.private & filters.command(["kingmahip"])) 20 | async def upgradecm(bot,message): 21 | text = """ **🖼️ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ** 22 | 23 | **⦿ yᴏᴜ ᴄᴀɴ ᴀᴅᴅ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ ꜱɪᴍᴩʟy ʙy ꜱᴇɴᴅɪɴɢ ᴀ ᴩʜᴏᴛᴏ ᴛᴏ ᴍᴇ....** 24 | 25 | **⦿ /viewthumb - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴛʜᴜᴍʙɴᴀɪʟ** 26 | **⦿ /delthumb - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴀᴍᴍᴏɴᴅ ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴛʜᴜᴍʙɴᴀɪʟ**""" 27 | keybord = InlineKeyboardMarkup([[ 28 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "upgrade")], 29 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "settings") ]]) 30 | await message.reply_text(text = text,reply_markup = keybord) 31 | -------------------------------------------------------------------------------- /plugins/settings.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | 5 | @Client.on_callback_query(filters.regex('settings')) 6 | async def upgrade(bot,update): 7 | text = """ **⚙️ ꜱᴇᴛᴛɪɴɢꜱ** 8 | 9 | **ᴄᴏɴꜰɪɢᴜʀᴇ ꜱᴇᴛᴛɪɴɢꜱ ᴀꜱ yᴏᴜʀ ᴡɪꜱʜ**""" 10 | keybord = InlineKeyboardMarkup([[ 11 | InlineKeyboardButton("• ᴛʜᴜᴍʙɴᴀɪʟ ꜱᴇᴛᴛɪɴɢꜱ •",callback_data = "kingmahip")], 12 | [InlineKeyboardButton("• ᴄᴀᴩᴛɪᴏɴ ꜱᴇᴛᴛɪɴɢꜱ •",callback_data = "kingppt"), 13 | InlineKeyboardButton("• ᴩʀᴇᴍɪᴜᴍ ᴩʟᴀɴꜱ •",callback_data = "upgrade")],[InlineKeyboardButton("• ᴄʟᴏꜱᴇ •",callback_data = "cancel") ]]) 14 | await update.message.edit(text = text,reply_markup = keybord) 15 | 16 | 17 | @Client.on_message(filters.private & filters.command(["settings"])) 18 | async def upgradecm(bot,message): 19 | text = """ **⚙️ ꜱᴇᴛᴛɪɴɢꜱ** 20 | 21 | **ᴄᴏɴꜰɪɢᴜʀᴇ ꜱᴇᴛᴛɪɴɢꜱ ᴀꜱ yᴏᴜʀ ᴡɪꜱʜ**""" 22 | keybord = InlineKeyboardMarkup([[ 23 | InlineKeyboardButton("• ᴛʜᴜᴍʙɴᴀɪʟ ꜱᴇᴛᴛɪɴɢꜱ •",callback_data = "kingmahip")], 24 | [InlineKeyboardButton("• ᴄᴀᴩᴛɪᴏɴ ꜱᴇᴛᴛɪɴɢꜱ •",callback_data = "kingppt"), 25 | InlineKeyboardButton("• ᴩʀᴇᴍɪᴜᴍ ᴩʟᴀɴꜱ •",callback_data = "upgrade")],[InlineKeyboardButton("• ᴄʟᴏꜱᴇ •",callback_data = "cancel") ]]) 26 | await message.reply_text(text = text,reply_markup = keybord) 27 | -------------------------------------------------------------------------------- /plugins/caption.py: -------------------------------------------------------------------------------- 1 | from pyrogram import Client, filters 2 | from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton 3 | from helper.database import * 4 | from config import * 5 | 6 | @Client.on_message(filters.private & filters.command('set_caption')) 7 | async def add_caption(client, message): 8 | if len(message.command) == 1: 9 | return await message.reply_text("**Give me a caption to set.\n\nExample:- `/set_caption {filename}`**") 10 | caption = message.text.split(" ", 1)[1] 11 | addcaption(int(message.chat.id), caption) 12 | await message.reply_text("**yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy ᴀᴅᴅᴇᴅ !!**") 13 | 14 | @Client.on_message(filters.private & filters.command('del_caption')) 15 | async def delete_caption(client, message): 16 | caption = find(int(message.chat.id))[1] 17 | if not caption: 18 | await message.reply_text("**yᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀɴy ᴄᴏꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!**") 19 | return 20 | delcaption(int(message.chat.id)) 21 | await message.reply_text("**yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy ᴅᴇʟᴇᴛᴇᴅ !!**") 22 | 23 | @Client.on_message(filters.private & filters.command('see_caption')) 24 | async def see_caption(client, message): 25 | caption = find(int(message.chat.id))[1] 26 | if caption: 27 | await message.reply_text(f"Your Caption:\n\n`{caption}`") 28 | else: 29 | await message.reply_text("**yᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀɴy ᴄᴏꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!**") 30 | 31 | -------------------------------------------------------------------------------- /plugins/gold.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | from config import * 5 | 6 | @Client.on_callback_query(filters.regex('21k1')) 7 | async def upgrade(bot,update): 8 | text = """ **🏷 ᴘʟᴀɴ** :- ```Gold 🏆``` 9 | 10 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```50.0 GB``` 11 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```0 minutes``` 12 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```True``` 13 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```6``` 14 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```30 Days``` 15 | 16 | **💰 ᴘʀɪᴄᴇ 99₹ ᴘᴇʀ ᴍᴏɴᴛʜ**""" 17 | keybord = InlineKeyboardMarkup([[ 18 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "kingmsaa")], 19 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "upgrade") ]]) 20 | await update.message.edit(text = text,reply_markup = keybord) 21 | 22 | 23 | @Client.on_message(filters.private & filters.command(["21k1"])) 24 | async def upgradecm(bot,message): 25 | text = """ **🏷 ᴘʟᴀɴ** :- ```Gold 🏆``` 26 | 27 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```50.0 GB``` 28 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```0 minutes``` 29 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```True``` 30 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```6``` 31 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```30 Days``` 32 | 33 | **💰 ᴘʀɪᴄᴇ 99₹ ᴘᴇʀ ᴍᴏɴᴛʜ**""" 34 | keybord = InlineKeyboardMarkup([[ 35 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "kingmsaa")], 36 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "upgrade") ]]) 37 | await message.reply_text(text = text,reply_markup = keybord) 38 | -------------------------------------------------------------------------------- /plugins/silver.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | from config import * 5 | 6 | @Client.on_callback_query(filters.regex('zdogrocky')) 7 | async def upgrade(bot,update): 8 | text = """ **🏷 ᴘʟᴀɴ** :- ```Silver 🥈``` 9 | 10 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```10.0 GB``` 11 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```0 minutes``` 12 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```False``` 13 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```3``` 14 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```30 Days``` 15 | 16 | **💰 ᴘʀɪᴄᴇ 59₹ ᴘᴇʀ ᴍᴏɴᴛʜ**""" 17 | keybord = InlineKeyboardMarkup([[ 18 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "kingmsaa")], 19 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "upgrade") ]]) 20 | await update.message.edit(text = text,reply_markup = keybord) 21 | 22 | 23 | @Client.on_message(filters.private & filters.command(["zdogrocky"])) 24 | async def upgradecm(bot,message): 25 | text = """ **🏷 ᴘʟᴀɴ** :- ```Silver 🥈``` 26 | 27 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```10.0 GB``` 28 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```0 minutes``` 29 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```False``` 30 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```3``` 31 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```30 Days``` 32 | 33 | **💰 ᴘʀɪᴄᴇ 59₹ ᴘᴇʀ ᴍᴏɴᴛʜ**""" 34 | keybord = InlineKeyboardMarkup([[ 35 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "kingmsaa")], 36 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "upgrade") ]]) 37 | await message.reply_text(text = text,reply_markup = keybord) 38 | -------------------------------------------------------------------------------- /plugins/diamond.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | from config import * 5 | 6 | @Client.on_callback_query(filters.regex('king5461')) 7 | async def upgrade(bot,update): 8 | text = """ **🏷 ᴘʟᴀɴ** :- ```Diamond 💎``` 9 | 10 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```Unlimited``` 11 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```0 minutes``` 12 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```True``` 13 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```No Limit``` 14 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```30 Days``` 15 | 16 | **💰 ᴘʀɪᴄᴇ 159₹ ᴘᴇʀ ᴍᴏɴᴛʜ**""" 17 | keybord = InlineKeyboardMarkup([[ 18 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "kingmsaa")], 19 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "upgrade") ]]) 20 | await update.message.edit(text = text,reply_markup = keybord) 21 | 22 | 23 | @Client.on_message(filters.private & filters.command(["king5461"])) 24 | async def upgradecm(bot,message): 25 | text = """ **🏷 ᴘʟᴀɴ** :- ```Diamond 💎``` 26 | 27 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```Unlimited``` 28 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```0 minutes``` 29 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```True``` 30 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```No Limit``` 31 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```30 Days``` 32 | 33 | **💰 ᴘʀɪᴄᴇ 159₹ ᴘᴇʀ ᴍᴏɴᴛʜ**""" 34 | keybord = InlineKeyboardMarkup([[ 35 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "kingmsaa")], 36 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "upgrade") ]]) 37 | await message.reply_text(text = text,reply_markup = keybord) 38 | -------------------------------------------------------------------------------- /plugins/thaption.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | from config import * 5 | 6 | @Client.on_callback_query(filters.regex('kingppt')) 7 | async def upgrade(bot,update): 8 | text = """ **📝 ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ** 9 | 10 | **⦿ /set_caption - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ** 11 | **⦿ /see_caption - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ** 12 | **⦿ /del_caption - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴀᴍᴍᴏɴᴅ ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ** 13 | **⦿ EX :-** ```/set_caption 14 | 📕 Fɪʟᴇ Nᴀᴍᴇ: {filename} 15 | 💾 Sɪᴢᴇ: {filesize}```""" 16 | keybord = InlineKeyboardMarkup([[ 17 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "upgrade")], 18 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "settings") ]]) 19 | await update.message.edit(text = text,reply_markup = keybord) 20 | 21 | 22 | @Client.on_message(filters.private & filters.command(["kingppt"])) 23 | async def upgradecm(bot,message): 24 | text = """ **📝 ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ** 25 | 26 | **⦿ /set_caption - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ** 27 | **⦿ /see_caption - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ** 28 | **⦿ /del_caption - ᴜꜱᴇ ᴛʜɪꜱ ᴄᴀᴍᴍᴏɴᴅ ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴄᴀᴩᴛɪᴏɴ** 29 | **⦿ EX :-** ```/set_caption 30 | 📕 Fɪʟᴇ Nᴀᴍᴇ: {filename} 31 | 💾 Sɪᴢᴇ: {filesize}```""" 32 | keybord = InlineKeyboardMarkup([[ 33 | InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ",callback_data = "upgrade")], 34 | [InlineKeyboardButton("• ʙᴀᴄᴋ •",callback_data = "settings") ]]) 35 | await message.reply_text(text = text,reply_markup = keybord) 36 | -------------------------------------------------------------------------------- /plugins/kingmsaa.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | from config import * 5 | 6 | @Client.on_callback_query(filters.regex('kingmsaa')) 7 | async def upgrade(bot,update): 8 | text = f"""**ᴩᴀyᴍᴇɴᴛ ᴅɪᴛᴇʟꜱ ** 9 | 10 | **Silver 🥈 :- 59₹** 11 | **Gold 🏆 :- 99₹** 12 | **Diamond 💎 :- 159₹** 13 | 14 | **⌾ My Nᴀᴍᴇ - Thiruselvan** 15 | 16 | **⌾ Pʜᴏɴᴇ Pᴀy - Uᴩɪ :-** ```ThiruXD@ibl``` 17 | 18 | **🇳 🇴 🇹 🇪 :- ᴀꜰᴛᴇʀ ᴩᴀyᴍᴇɴᴛ ꜱᴇɴᴅ ꜱᴄʀᴇᴇɴ ꜱʜᴏᴛ'ꜱ ᴏꜰ ᴩᴀyᴍᴇɴᴛ ᴛᴏ ᴍᴇ - @{OWNER_USERNAME}**""" 19 | keybord = InlineKeyboardMarkup([[ 20 | InlineKeyboardButton("📸 Sᴇɴᴅ Mᴇ Sᴄʀᴇᴇɴꜱʜᴏᴛ 📸", url=f'https://t.me/{OWNER_USERNAME}')],[InlineKeyboardButton('°• Bᴀᴄᴋ •°', callback_data='upgrade') ]]) 21 | await update.message.edit(text = text,reply_markup = keybord) 22 | 23 | 24 | @Client.on_message(filters.private & filters.command(["kingmsaa"])) 25 | async def upgradecm(bot,message): 26 | text = f"""**ᴩᴀyᴍᴇɴᴛ ᴅɪᴛᴇʟꜱ ** 27 | 28 | **Silver 🥈 :- 59₹** 29 | **Gold 🏆 :- 99₹** 30 | **Diamond 💎 :- 159₹** 31 | 32 | **⌾ My Nᴀᴍᴇ - Thiruselvan** 33 | 34 | **⌾ Pʜᴏɴᴇ Pᴀy - Uᴩɪ :-** ```ThiruXD@ibl``` 35 | 36 | **🇳 🇴 🇹 🇪 :- ᴀꜰᴛᴇʀ ᴩᴀyᴍᴇɴᴛ ꜱᴇɴᴅ ꜱᴄʀᴇᴇɴ ꜱʜᴏᴛ'ꜱ ᴏꜰ ᴩᴀyᴍᴇɴᴛ ᴛᴏ ᴍᴇ - @{OWNER_USERNAME}**""" 37 | keybord = InlineKeyboardMarkup([[ 38 | InlineKeyboardButton("📸 Sᴇɴᴅ Mᴇ Sᴄʀᴇᴇɴꜱʜᴏᴛ 📸", url=f'https://t.me/{OWNER_USERNAME}')],[InlineKeyboardButton('°• Bᴀᴄᴋ •°', callback_data='upgrade') ]]) 39 | await update.message.edit(text = text,reply_markup = keybord) 40 | 41 | -------------------------------------------------------------------------------- /plugins/upgrade.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | from config import * 5 | 6 | @Client.on_callback_query(filters.regex('upgrade')) 7 | async def upgrade(bot,update): 8 | text = """ **🏷 ᴄᴜʀʀᴇɴᴛ ᴘʟᴀɴ** :- ```Free``` 9 | 10 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```Upgrade``` 11 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```5 minutes``` 12 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```False``` 13 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```1``` 14 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```Life Time```""" 15 | keybord = InlineKeyboardMarkup([[ 16 | InlineKeyboardButton("🥈 ꜱɪʟᴠᴇʀ",callback_data = "zdogrocky")], 17 | [InlineKeyboardButton("🏆 ɢᴏʟᴅ",callback_data = "21k1"), 18 | InlineKeyboardButton("💎 ᴅɪᴀᴍᴏɴᴅ",callback_data = "king5461")],[InlineKeyboardButton("• ᴄʟᴏꜱᴇ •",callback_data = "cancel") ]]) 19 | await update.message.edit(text = text,reply_markup = keybord) 20 | 21 | 22 | @Client.on_message(filters.private & filters.command(["upgrade"])) 23 | async def upgradecm(bot,message): 24 | text = """ **🏷 ᴄᴜʀʀᴇɴᴛ ᴘʟᴀɴ** :- ```Free``` 25 | 26 | **⌾ ᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ** :- ```Upgrade``` 27 | **⌾ ᴛɪᴍᴇ ɢᴀᴘ** :- ```5 minutes``` 28 | **⌾ 4ɢʙ sᴜᴘᴘᴏʀᴛ** :- ```False``` 29 | **⌾ ᴘᴀʀᴀʟʟᴇʟ ᴘʀᴏᴄᴇss** :- ```1``` 30 | **⌾ ᴠᴀʟɪᴅɪᴛʏ** :- ```Life Time```""" 31 | keybord = InlineKeyboardMarkup([[ 32 | InlineKeyboardButton("🥈 ꜱɪʟᴠᴇʀ",callback_data = "zdogrocky")], 33 | [InlineKeyboardButton("🏆 ɢᴏʟᴅ",callback_data = "21k1"), 34 | InlineKeyboardButton("💎 ᴅɪᴀᴍᴏɴᴅ",callback_data = "king5461")],[InlineKeyboardButton("• ᴄʟᴏꜱᴇ •",callback_data = "cancel") ]]) 35 | await message.reply_text(text = text,reply_markup = keybord) 36 | -------------------------------------------------------------------------------- /helper/uploadbot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # (c) Hillard-har 4 | 5 | # the logging things 6 | import logging 7 | logging.basicConfig(level=logging.DEBUG, 8 | format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') 9 | logger = logging.getLogger(__name__) 10 | 11 | import os 12 | import requests 13 | 14 | def DetectFileSize(url): 15 | r = requests.get(url, allow_redirects=True, stream=True) 16 | total_size = int(r.headers.get("content-length", 0)) 17 | return total_size 18 | 19 | 20 | def DownLoadFile(url, file_name, chunk_size, client, ud_type, message_id, chat_id): 21 | if os.path.exists(file_name): 22 | os.remove(file_name) 23 | if not url: 24 | return file_name 25 | r = requests.get(url, allow_redirects=True, stream=True) 26 | # https://stackoverflow.com/a/47342052/4723940 27 | total_size = int(r.headers.get("content-length", 0)) 28 | downloaded_size = 0 29 | with open(file_name, 'wb') as fd: 30 | for chunk in r.iter_content(chunk_size=chunk_size): 31 | if chunk: 32 | fd.write(chunk) 33 | downloaded_size += chunk_size 34 | if client is not None: 35 | if ((total_size // downloaded_size) % 5) == 0: 36 | time.sleep(0.3) 37 | try: 38 | client.edit_message_text( 39 | chat_id, 40 | message_id, 41 | text="{}: {} of {}".format( 42 | ud_type, 43 | humanbytes(downloaded_size), 44 | humanbytes(total_size) 45 | ) 46 | ) 47 | except: 48 | pass 49 | return file_name 50 | -------------------------------------------------------------------------------- /plugins/myplane.py: -------------------------------------------------------------------------------- 1 | import time 2 | from pyrogram import Client, filters 3 | from pyrogram.types import ( 4 | InlineKeyboardButton, InlineKeyboardMarkup, ForceReply) 5 | from helper.database import find_one, used_limit 6 | from helper.database import daily as daily_ 7 | import datetime 8 | from datetime import timedelta, date, datetime 9 | from datetime import date as date_ 10 | from helper.progress import humanbytes 11 | from helper.database import daily as daily_ 12 | from helper.date import check_expi 13 | from helper.database import uploadlimit, usertype 14 | from config import * 15 | 16 | 17 | @Client.on_message(filters.private & filters.command(["myplan"])) 18 | async def start(client, message): 19 | used_ = find_one(message.from_user.id) 20 | daily = used_["daily"] 21 | expi = daily - \ 22 | int(time.mktime(time.strptime(str(date_.today()), '%Y-%m-%d'))) 23 | if expi != 0: 24 | today = date_.today() 25 | pattern = '%Y-%m-%d' 26 | epcho = int(time.mktime(time.strptime(str(today), pattern))) 27 | daily_(message.from_user.id, epcho) 28 | used_limit(message.from_user.id, 0) 29 | _newus = find_one(message.from_user.id) 30 | used = _newus["used_limit"] 31 | limit = _newus["uploadlimit"] 32 | remain = int(limit) - int(used) 33 | user = _newus["usertype"] 34 | ends = _newus["prexdate"] 35 | if ends: 36 | pre_check = check_expi(ends) 37 | if pre_check == False: 38 | uploadlimit(message.from_user.id, 10) 39 | usertype(message.from_user.id, "Free") 40 | if ends == None: 41 | text = f"**ᴜꜱᴇʀ ɪᴅ**:- ```{message.from_user.id}```\n**ᴩʟᴀɴ** :- {user}\n**ᴅᴀɪʟy ᴜᴩʟᴏᴀᴅ ʟɪᴍɪᴛ** :- {humanbytes(limit)}\n**ᴛᴏᴅᴀy ᴜꜱᴇᴅ** :- {humanbytes(used)}\n**ʀᴇᴍᴀɪɴ** :- {humanbytes(remain)}" 42 | else: 43 | normal_date = datetime.fromtimestamp(ends).strftime('%Y-%m-%d') 44 | text = f"**ᴜꜱᴇʀ ɪᴅ** :- ```{message.from_user.id}```\n**ᴩʟᴀɴ** :- {user}\n**ᴅᴀɪʟy ᴜᴩʟᴏᴀᴅ ʟɪᴍɪᴛ** :- {humanbytes(limit)}\n**ᴛᴏᴅᴀy ᴜꜱᴇᴅ** :- {humanbytes(used)}\n**ʀᴇᴍᴀɪɴ** :- {humanbytes(remain)}\n\n**yᴏᴜʀ ᴩʟᴀɴ ᴇɴᴅꜱ ᴏɴ** :- {normal_date}" 45 | 46 | if user == "Free": 47 | await message.reply(text, quote=True, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ", callback_data="upgrade"), InlineKeyboardButton("Cancel ✖️ ", callback_data="cancel")]])) 48 | else: 49 | await message.reply(text, quote=True) 50 | -------------------------------------------------------------------------------- /plugins/help.py: -------------------------------------------------------------------------------- 1 | """lokaman""" 2 | from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,ForceReply) 3 | from pyrogram import Client , filters 4 | from config import * 5 | 6 | @Client.on_callback_query(filters.regex('help')) 7 | async def upgrade(bot,update): 8 | text = """ **📚 ᴀᴠᴀɪʟᴀʙʟᴇ ᴄᴏᴍᴍᴀɴᴅꜱ :** 9 | ➢ /start - **ᴄʜᴇᴄᴋ ɪ'ᴍ ᴀʟɪᴠᴇ** 10 | ➢ /myplan - **ᴄʜᴇᴄᴋ yᴏᴜʀ ᴄᴜʀʀᴇɴᴛ ᴘʟᴀɴ** 11 | ➢ /upgrade - **ᴄʜᴇᴄᴋ ᴀᴠᴀɪʟᴀʙʟᴇ ᴩʟᴀɴ ɪɴꜰᴏ** 12 | ➢ /settings - **ᴄᴏɴꜰɪɢᴜʀᴇ yᴏᴜʀ ꜱᴇᴛᴛɪɴɢꜱ** 13 | ➢ /set_caption - **ᴛᴏ ᴀᴅᴅ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!** 14 | ➢ /see_caption - **ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!** 15 | ➢ /del_caption - **ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!** 16 | ➢ /viewthumb - **ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ !!** 17 | ➢ /delthumb - **ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ !!** 18 | ➢ /admin - **ᴀᴅᴍɪɴ ᴄᴏᴍᴍᴀɴᴅꜱ** 19 | 20 | **• ᴜᴩɢʀᴀᴅᴇ yᴏᴜʀ ᴩʀᴇᴍɪᴜᴍ ᴩʟᴀɴ ꜰᴏʀ ʙᴇᴛᴛᴇʀ ʀᴇɴᴀᴍɪɴɢ ᴇxᴩᴇʀɪᴇɴᴄᴇ.** 21 | **• ꜱᴇɴᴅ ᴀ ᴩʜᴏᴛᴏ ᴛᴏ ᴍᴇ ᴛᴏ ᴀᴅᴅ ᴀꜱ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ** 22 | **• ꜱᴇɴᴅ yᴏᴜʀ ꜰɪʟᴇꜱ ᴛᴏ ᴍᴇ ᴛᴏ ʀᴇɴᴀᴍᴇ**""" 23 | keybord = InlineKeyboardMarkup([[ 24 | InlineKeyboardButton("⚙ Sᴇᴛᴛɪɴɢꜱ ",callback_data = "settings")], 25 | [InlineKeyboardButton("Cʜᴀɴɴᴇʟ", url=f'https://t.me/{UPDATES_CHANNEL}'), 26 | InlineKeyboardButton("💳 Uᴩɢʀᴀᴅᴇ",callback_data = "upgrade")],[InlineKeyboardButton("• ᴄʟᴏꜱᴇ •",callback_data = "cancel") ]]) 27 | await update.message.edit(text = text,reply_markup = keybord) 28 | 29 | 30 | @Client.on_message(filters.private & filters.command(["help"])) 31 | async def upgradecm(bot,message): 32 | text = """ **📚 ᴀᴠᴀɪʟᴀʙʟᴇ ᴄᴏᴍᴍᴀɴᴅꜱ :** 33 | ➢ /start - **ᴄʜᴇᴄᴋ ɪ'ᴍ ᴀʟɪᴠᴇ** 34 | ➢ /myplan - **ᴄʜᴇᴄᴋ yᴏᴜʀ ᴄᴜʀʀᴇɴᴛ ᴘʟᴀɴ** 35 | ➢ /upgrade - **ᴄʜᴇᴄᴋ ᴀᴠᴀɪʟᴀʙʟᴇ ᴩʟᴀɴ ɪɴꜰᴏ** 36 | ➢ /settings - **ᴄᴏɴꜰɪɢᴜʀᴇ yᴏᴜʀ ꜱᴇᴛᴛɪɴɢꜱ** 37 | ➢ /set_caption - **ᴛᴏ ᴀᴅᴅ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!** 38 | ➢ /see_caption - **ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!** 39 | ➢ /del_caption - **ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴄᴀᴩᴛɪᴏɴ !!** 40 | ➢ /viewthumb - **ᴛᴏ ꜱᴇᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ !!** 41 | ➢ /delthumb - **ᴛᴏ ᴅᴇʟᴇᴛᴇ yᴏᴜʀ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ !!** 42 | ➢ /admin - **ᴀᴅᴍɪɴ ᴄᴏᴍᴍᴀɴᴅꜱ** 43 | 44 | **• ᴜᴩɢʀᴀᴅᴇ yᴏᴜʀ ᴩʀᴇᴍɪᴜᴍ ᴩʟᴀɴ ꜰᴏʀ ʙᴇᴛᴛᴇʀ ʀᴇɴᴀᴍɪɴɢ ᴇxᴩᴇʀɪᴇɴᴄᴇ.** 45 | **• ꜱᴇɴᴅ ᴀ ᴩʜᴏᴛᴏ ᴛᴏ ᴍᴇ ᴛᴏ ᴀᴅᴅ ᴀꜱ ᴄᴜꜱᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ** 46 | **• ꜱᴇɴᴅ yᴏᴜʀ ꜰɪʟᴇꜱ ᴛᴏ ᴍᴇ ᴛᴏ ʀᴇɴᴀᴍᴇ**""" 47 | keybord = InlineKeyboardMarkup([[ 48 | InlineKeyboardButton("⚙ Sᴇᴛᴛɪɴɢꜱ ",callback_data = "settings")], 49 | [InlineKeyboardButton("Cʜᴀɴɴᴇʟ", url=f'https://t.me/{UPDATES_CHANNEL}'), 50 | InlineKeyboardButton("💳 Uᴩɢʀᴀᴅᴇ",callback_data = "upgrade")],[InlineKeyboardButton("• ᴄʟᴏꜱᴇ •",callback_data = "cancel") ]]) 51 | await message.reply_text(text = text,reply_markup = keybord) 52 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | 4 | "name": "Gangster Baby Renamer Bot", 5 | 6 | "description": "Telegram File Renamer Bot 4GB ", 7 | 8 | "keywords": [ 9 | 10 | "Gangster Baby Renamer Bot ", 11 | 12 | "4GB File", 13 | 14 | "telegram", 15 | 16 | "LazyDeveloperr" 17 | 18 | ], 19 | 20 | "repository": "https://github.com/Maheshbot99/Rename1", 21 | 22 | "success_url": "https://telegram.dog/Cinema_Rockets", 23 | 24 | "env": { 25 | 26 | "CHANNEL": { 27 | 28 | "description": "Channel or Group user Name With @", 29 | 30 | "required":true 31 | 32 | 33 | 34 | }, 35 | 36 | "STRING": { 37 | 38 | "description": "Pyrogram String Session Use @genStr_Bot", 39 | 40 | "required": true 41 | 42 | }, 43 | 44 | "API_ID": { 45 | 46 | "description": "Your APP ID From my.telegram.org ", 47 | 48 | "required": true 49 | 50 | }, 51 | 52 | "API_HASH": { 53 | 54 | "description": "Your API Hash From my.telegram.org ", 55 | 56 | "required": true 57 | 58 | }, 59 | 60 | "TOKEN": { 61 | 62 | "description": "Your Bot Token From @BotFather", 63 | 64 | "required": true 65 | 66 | }, 67 | 68 | "ADMIN": { 69 | 70 | "description":"Add Your User ID", 71 | 72 | "required": true 73 | 74 | }, 75 | 76 | "DB_URL":{ 77 | 78 | "description":"Database Url Get It From Mongo DB" 79 | 80 | }, 81 | 82 | "DB_NAME":{ 83 | 84 | "description":"Database Name ", 85 | 86 | "required":true 87 | 88 | }, 89 | 90 | "LOG_CHANNEL":{ 91 | 92 | "description":"Channel Id Nedd Store Files Get Your channel id from Rose @MissRose_bot", 93 | 94 | "required": true 95 | 96 | }, 97 | "LAZY_PIC":{ 98 | 99 | "description":"Start up pic of your bot. Get from telegraph_Bot", 100 | 101 | "required": true 102 | 103 | } 104 | 105 | 106 | 107 | }, 108 | 109 | "buildpacks": [ 110 | 111 | { 112 | 113 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" 114 | 115 | }, 116 | 117 | { 118 | 119 | "url": "heroku/python" 120 | 121 | } 122 | 123 | ] 124 | 125 | } 126 | -------------------------------------------------------------------------------- /helper/progress.py: -------------------------------------------------------------------------------- 1 | import math 2 | import time 3 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 4 | 5 | async def progress_for_pyrogram( 6 | current, 7 | total, 8 | ud_type, 9 | message, 10 | start 11 | ): 12 | 13 | now = time.time() 14 | diff = now - start 15 | if round(diff % 10.00) == 0 or current == total: 16 | # if round(current / total * 100, 0) % 5 == 0: 17 | percentage = current * 100 / total 18 | speed = current / diff 19 | elapsed_time = round(diff) * 1000 20 | time_to_completion = round((total - current) / speed) * 1000 21 | estimated_total_time = elapsed_time + time_to_completion 22 | 23 | elapsed_time = TimeFormatter(milliseconds=elapsed_time) 24 | estimated_total_time = TimeFormatter(milliseconds=estimated_total_time) 25 | 26 | progress = "[{0}{1}] \n**Progress**: {2}%\n".format( 27 | ''.join(["●" for i in range(math.floor(percentage / 5))]), 28 | ''.join(["○" for i in range(20 - math.floor(percentage / 5))]), 29 | round(percentage, 2)) 30 | 31 | tmp = progress + "{0} of {1}\n**Speed**: {2}/s\n**ETA**: {3}\n".format( 32 | humanbytes(current), 33 | humanbytes(total), 34 | humanbytes(speed), 35 | # elapsed_time if elapsed_time != '' else "0 s", 36 | estimated_total_time if estimated_total_time != '' else "0 s" 37 | ) 38 | try: 39 | await message.edit( 40 | text="{}\n {}".format( 41 | ud_type, 42 | tmp 43 | ) 44 | ) 45 | except: 46 | pass 47 | 48 | 49 | def humanbytes(size): 50 | # https://stackoverflow.com/a/49361727/4723940 51 | # 2**10 = 1024 52 | if not size: 53 | return "" 54 | power = 2**10 55 | n = 0 56 | Dic_powerN = {0: ' ', 1: 'Ki', 2: 'Mi', 3: 'Gi', 4: 'Ti'} 57 | while size > power: 58 | size /= power 59 | n += 1 60 | return str(round(size, 2)) + " " + Dic_powerN[n] + 'B' 61 | 62 | 63 | def TimeFormatter(milliseconds: int) -> str: 64 | seconds, milliseconds = divmod(int(milliseconds), 1000) 65 | minutes, seconds = divmod(seconds, 60) 66 | hours, minutes = divmod(minutes, 60) 67 | days, hours = divmod(hours, 24) 68 | tmp = ((str(days) + "d, ") if days else "") + \ 69 | ((str(hours) + "h, ") if hours else "") + \ 70 | ((str(minutes) + "m, ") if minutes else "") + \ 71 | ((str(seconds) + "s, ") if seconds else "") + \ 72 | ((str(milliseconds) + "ms, ") if milliseconds else "") 73 | return tmp[:-2] 74 | -------------------------------------------------------------------------------- /helper/ffmpeg.py: -------------------------------------------------------------------------------- 1 | import time 2 | import os 3 | import asyncio 4 | from PIL import Image 5 | from hachoir.metadata import extractMetadata 6 | from hachoir.parser import createParser 7 | 8 | async def fix_thumb(thumb): 9 | width = 0 10 | height = 0 11 | try: 12 | if thumb != None: 13 | metadata = extractMetadata(createParser(thumb)) 14 | if metadata.has("width"): 15 | width = metadata.get("width") 16 | if metadata.has("height"): 17 | height = metadata.get("height") 18 | Image.open(thumb).convert("RGB").save(thumb) 19 | img = Image.open(thumb) 20 | img.resize((320, height)) 21 | img.save(thumb, "JPEG") 22 | except Exception as e: 23 | print(e) 24 | thumb = None 25 | 26 | return width, height, thumb 27 | 28 | async def take_screen_shot(video_file, output_directory, ttl): 29 | # https://stackoverflow.com/a/13891070/4723940 30 | out_put_file_name = output_directory + \ 31 | "/" + str(time.time()) + ".jpg" 32 | file_genertor_command = [ 33 | "ffmpeg", 34 | "-ss", 35 | str(ttl), 36 | "-i", 37 | video_file, 38 | "-vframes", 39 | "1", 40 | out_put_file_name 41 | ] 42 | # width = "90" 43 | process = await asyncio.create_subprocess_exec( 44 | *file_genertor_command, 45 | # stdout must a pipe to be accessible as process.stdout 46 | stdout=asyncio.subprocess.PIPE, 47 | stderr=asyncio.subprocess.PIPE, 48 | ) 49 | # Wait for the subprocess to finish 50 | stdout, stderr = await process.communicate() 51 | e_response = stderr.decode().strip() 52 | t_response = stdout.decode().strip() 53 | if os.path.lexists(out_put_file_name): 54 | return out_put_file_name 55 | else: 56 | return None 57 | 58 | async def generate_screen_shots( 59 | video_file, 60 | output_directory, 61 | is_watermarkable, 62 | wf, 63 | min_duration, 64 | no_of_photos 65 | ): 66 | metadata = extractMetadata(createParser(video_file)) 67 | duration = 0 68 | if metadata is not None: 69 | if metadata.has("duration"): 70 | duration = metadata.get('duration').seconds 71 | if duration > min_duration: 72 | images = [] 73 | ttl_step = duration // no_of_photos 74 | current_ttl = ttl_step 75 | for looper in range(0, no_of_photos): 76 | ss_img = await take_screen_shot(video_file, output_directory, current_ttl) 77 | current_ttl = current_ttl + ttl_step 78 | if is_watermarkable: 79 | ss_img = await place_water_mark(ss_img, output_directory + "/" + str(time.time()) + ".jpg", wf) 80 | images.append(ss_img) 81 | return images 82 | else: 83 | return None 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 
2 |
3 |
4 | 💰 𝙋𝙍𝙄𝙑𝘼𝙏𝙀 𝙍𝙀𝙋𝙊 💰
9 | 10 | 11 | ### **𝑅𝐸𝑄𝑈𝐼𝑅𝐸𝐷 𝑉𝐴𝑅𝐼𝐴𝐵𝐿𝐸𝑆** 12 | 13 | * `TOKEN` - Get bot token from @BotFather 14 | 15 | * `API_ID` - From my.telegram.org 16 | 17 | * `API_HASH` - From my.telegram.org 18 | 19 | * `ADMIN` - AUTH or bot controllers id's multiple id use space to split 20 | 21 | * `DB_URL` - Mongo Database URL from https://cloud.mongodb.com/ 22 | 23 | * `DB_NAME` - Your database name from mongoDB. Default will be 'my' 24 | 25 | * `LOG_CHANNEL` - Log Channel I'D 26 | 27 | * `LAZY_PIC` - start message photo 28 | 29 | 30 | ### **⚡️ 𝑂𝑃𝑇𝐼𝑂𝑁𝐴𝐿 𝑉𝐴𝑅𝐼𝐴𝐵𝐿𝐸𝑆** 31 | 32 | * `STRING` - If you want to rename 4GB+ files. `[Note :- Remove string if bot don't works]` 33 | 34 | * `CHANNEL` - your force sub channel username without @ 35 | 36 | 37 | 38 | ### 🚦 User Commands 39 | ``` 40 | start - 𝐶ℎ𝑒𝑐𝑘 𝐼'𝑚 𝐴𝑙𝑖𝑣𝑒 41 | myplan - 𝐶ℎ𝑒𝑐𝑘 𝑌𝑜𝑢𝑟 𝐶𝑢𝑟𝑟𝑒𝑛𝑡 𝑃𝑙𝑎𝑛 42 | upgrade - 𝐶ℎ𝑒𝑐𝑘 𝐴𝑣𝑎𝑖𝑙𝑎𝑏𝑙𝑒 𝑃𝑙𝑎𝑛 𝐼𝑛𝑓𝑜 43 | settings - 𝐶𝑜𝑛𝑓𝑖𝑔𝑢𝑟𝑒 𝑌𝑜𝑢𝑟 𝑆𝑒𝑡𝑡𝑖𝑛𝑔𝑠 44 | set_caption - 𝑇𝑜 𝐴𝑑𝑑 𝑌𝑜𝑢𝑟 𝐶𝑜𝑠𝑡𝑜𝑚 𝐶𝑎𝑝𝑡𝑎𝑖𝑛 45 | see_caption - 𝑇𝑜 𝑆𝑒𝑒 𝑌𝑜𝑢𝑟 𝐶𝑜𝑠𝑡𝑜𝑚 𝐶𝑎𝑝𝑡𝑎𝑖𝑛 46 | del_caption - 𝑇𝑜 𝐷𝑒𝑙𝑒𝑡𝑒 𝑌𝑜𝑢𝑟 𝐶𝑜𝑠𝑡𝑜𝑚 𝐶𝑎𝑝𝑡𝑎𝑖𝑛 47 | viewthumb - 𝑇𝑜 𝑆𝑒𝑒 𝑌𝑜𝑢𝑟 𝐶𝑜𝑠𝑡𝑜𝑚 𝑇ℎ𝑢𝑚𝑏𝑛𝑎𝑖𝑙 48 | delthumb - 𝑇𝑜 𝐷𝑒𝑙𝑒𝑡𝑒 𝑌𝑜𝑢𝑟 𝐶𝑜𝑠𝑡𝑜𝑚 𝑇ℎ𝑢𝑚𝑏𝑛𝑎𝑖𝑙 49 | refer - 𝑅𝑒𝑓𝑒𝑟 𝐴𝑛𝑑 𝐸𝑎𝑟𝑛 100𝑀𝐵 𝑈𝑝𝑙𝑜𝑎𝑑 𝐿𝑖𝑚𝑖𝑡𝑒 50 | restart - 𝑅𝑒𝑠𝑡𝑎𝑟𝑡 𝐵𝑜𝑡 51 | ``` 52 | 53 | ### Admin Commands 54 | ``` 55 | users - 𝑇𝑜 𝑣𝑖𝑒𝑤 𝑙𝑖𝑠𝑡 𝑜𝑓 𝑢𝑠𝑒𝑟𝑠, 𝑢𝑠𝑖𝑛𝑔 𝐵𝑂𝑇 [𝐹𝑂𝑅 𝐴𝐷𝑀𝐼𝑁𝑆 𝑈𝑆𝐸 𝑂𝑁𝐿𝑌] 56 | 57 | broadcast - 𝑀𝑒𝑠𝑠𝑎𝑔𝑒 𝐵𝑟𝑜𝑎𝑑𝑐𝑎𝑠𝑡 𝑐𝑜𝑚𝑚𝑎𝑛𝑑 [𝐹𝑂𝑅 𝐴𝐷𝑀𝐼𝑁𝑆 𝑈𝑆𝐸 𝑂𝑁𝐿𝑌]. 58 | 59 | ceasepower - 𝑇𝑜 𝑐𝑒𝑎𝑠𝑒(𝑑𝑜𝑤𝑛𝑔𝑟𝑎𝑑𝑒) 𝑟𝑒𝑛𝑎𝑚𝑖𝑛𝑔 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 [𝐹𝑂𝑅 𝐴𝐷𝑀𝐼𝑁𝑆 𝑈𝑆𝐸 𝑂𝑁𝐿𝑌]. 60 | 61 | resetpower - 𝑇𝑜 𝑟𝑒𝑠𝑒𝑡 𝑟𝑒𝑛𝑎𝑚𝑖𝑛𝑔 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 (𝑡𝑜 𝑑𝑒𝑓𝑎𝑢𝑙𝑡 2.0 𝐺𝐵) [𝐹𝑂𝑅 𝐴𝐷𝑀𝐼𝑁𝑆 𝑈𝑆𝐸 𝑂𝑁𝐿𝑌]. 62 | 63 | addpremium - 𝑇𝑜 𝑢𝑝𝑔𝑟𝑎𝑑𝑒 𝑢𝑠𝑒𝑟 𝑝𝑙𝑎𝑛 𝑡𝑜 𝑆𝐼𝐿𝑉𝐸𝑅 - 𝐺𝑂𝐿𝐷 - 𝐷𝐼𝐴𝑀𝑂𝑁𝐷 [𝐹𝑂𝑅 𝐴𝐷𝑀𝐼𝑁𝑆 𝑈𝑆𝐸 𝑂𝑁𝐿𝑌]. 64 | ``` 65 | 66 | ### 🔗 𝐂𝐨𝐧𝐭𝐚𝐜𝐭 𝐔𝐬 67 | - [ ᴏᴡɴᴇʀ ᴏꜰ ᴛʜɪꜱ ʀᴇᴩᴏ](https://telegram.me/HMF_Owner_1) 68 | - [ᴄʜᴀɴɴᴇʟ](https://telegram.me/ATL_Univers) 69 | - [ᴅᴇᴍᴏ ʙᴏᴛ](https://telegram.me/RenameTwo_Bot) 70 | 71 | 72 | 73 | #### 🔗 𝘿𝙀𝙋𝙇𝙊𝙔 𝙃𝙀𝙍𝙀 74 | - [ʜᴇʀᴏᴋᴜ](https://heroku.com/deploy?template=https://github.com/ThiruXD/ATL-Rename-Bot) 75 | - [ᴋᴏyᴇʙ](https://app.koyeb.com/deploy?type=git&repository=github.com/ThiruXD/ATL-Rename-Bot&branch=main&name=pvtrename) 76 | -------------------------------------------------------------------------------- /plugins/filedetect.py: -------------------------------------------------------------------------------- 1 | from pyrogram import Client, filters 2 | from pyrogram.types import ( 3 | InlineKeyboardButton, InlineKeyboardMarkup, ForceReply) 4 | from config import * 5 | 6 | 7 | @Client.on_message(filters.private & filters.reply) 8 | async def refunc(client, message): 9 | if (message.reply_to_message.reply_markup) and isinstance(message.reply_to_message.reply_markup, ForceReply): 10 | new_name = message.text 11 | await message.delete() 12 | media = await client.get_messages(message.chat.id, message.reply_to_message.id) 13 | file = media.reply_to_message.document or media.reply_to_message.video or media.reply_to_message.audio 14 | filename = file.file_name 15 | types = file.mime_type.split("/") 16 | mime = types[0] 17 | mg_id = media.reply_to_message.id 18 | try: 19 | out = new_name.split(".") 20 | out[1] 21 | out_name = out[-1] 22 | out_filename = new_name 23 | await message.reply_to_message.delete() 24 | if mime == "video": 25 | markup = InlineKeyboardMarkup([[ 26 | InlineKeyboardButton("📁 ᴅᴏᴄᴜᴍᴇɴᴛ", callback_data="doc"), 27 | InlineKeyboardButton("🎥 ᴠɪᴅᴇᴏ", callback_data="vid")]]) 28 | elif mime == "audio": 29 | markup = InlineKeyboardMarkup([[InlineKeyboardButton( 30 | "📁 ᴅᴏᴄᴜᴍᴇɴᴛ", callback_data="doc"), InlineKeyboardButton("🎵 ᴀᴜᴅɪᴏ", callback_data="aud")]]) 31 | else: 32 | markup = InlineKeyboardMarkup( 33 | [[InlineKeyboardButton("📁 ᴅᴏᴄᴜᴍᴇɴᴛ", callback_data="doc")]]) 34 | # dont chenge this message.reply_text 35 | await message.reply_text(f"**__𝑆𝑒𝑙𝑒𝑐𝑡 𝑇ℎ𝑒 𝑂𝑢𝑡𝑝𝑢𝑡 𝐹𝑖𝑙𝑒 𝑇𝑦𝑝𝑒__**\n**__𝑁𝑒𝑤 𝐹𝑖𝑙𝑒𝑁𝑎𝑚𝑒__** :- ```{out_filename}```", reply_to_message_id=mg_id, reply_markup=markup) 36 | 37 | except: 38 | try: 39 | out = filename.split(".") 40 | out_name = out[-1] 41 | out_filename = new_name + "." + out_name 42 | except: 43 | await message.reply_to_message.delete() 44 | await message.reply_text("**Error** : No Extension in File, Not Supporting", reply_to_message_id=mg_id) 45 | return 46 | await message.reply_to_message.delete() 47 | if mime == "video": 48 | markup = InlineKeyboardMarkup([[InlineKeyboardButton( 49 | "📁 ᴅᴏᴄᴜᴍᴇɴᴛ", callback_data="doc"), InlineKeyboardButton("🎥 ᴠɪᴅᴇᴏ", callback_data="vid")]]) 50 | elif mime == "audio": 51 | markup = InlineKeyboardMarkup([[InlineKeyboardButton( 52 | "📁 ᴅᴏᴄᴜᴍᴇɴᴛ", callback_data="doc"), InlineKeyboardButton("🎵 ᴀᴜᴅɪᴏ", callback_data="aud")]]) 53 | else: 54 | markup = InlineKeyboardMarkup( 55 | [[InlineKeyboardButton("📁 ᴅᴏᴄᴜᴍᴇɴᴛ", callback_data="doc")]]) 56 | # dont chenge this message.reply_text 57 | await message.reply_text(f"**__𝑆𝑒𝑙𝑒𝑐𝑡 𝑇ℎ𝑒 𝑂𝑢𝑡𝑝𝑢𝑡 𝐹𝑖𝑙𝑒 𝑇𝑦𝑝𝑒__**\n**__𝑁𝑒𝑤 𝐹𝑖𝑙𝑒𝑁𝑎𝑚𝑒__** :- ```{out_filename}```", 58 | reply_to_message_id=mg_id, reply_markup=markup) 59 | -------------------------------------------------------------------------------- /helper/database.py: -------------------------------------------------------------------------------- 1 | import pymongo 2 | import os 3 | from helper.date import add_date 4 | from config import * 5 | mongo = pymongo.MongoClient(DB_URL) 6 | db = mongo[DB_NAME] 7 | dbcol = db["user"] 8 | 9 | 10 | def total_user(): 11 | user = dbcol.count_documents({}) 12 | return user 13 | 14 | # insert bot Data 15 | 16 | 17 | def botdata(chat_id): 18 | bot_id = int(chat_id) 19 | try: 20 | bot_data = {"_id": bot_id, "total_rename": 0, "total_size": 0} 21 | dbcol.insert_one(bot_data) 22 | except: 23 | pass 24 | 25 | 26 | def total_rename(chat_id, renamed_file): 27 | now = int(renamed_file) + 1 28 | dbcol.update_one({"_id": chat_id}, {"$set": {"total_rename": str(now)}}) 29 | 30 | 31 | def total_size(chat_id, total_size, now_file_size): 32 | now = int(total_size) + now_file_size 33 | dbcol.update_one({"_id": chat_id}, {"$set": {"total_size": str(now)}}) 34 | 35 | 36 | # insert user data 37 | def insert(chat_id): 38 | user_id = int(chat_id) 39 | user_det = {"_id": user_id, "file_id": None, "caption": None, "daily": 0, "date": 0, 40 | "uploadlimit": 2147483648, "used_limit": 0, "usertype": "Free", "prexdate": None} 41 | try: 42 | dbcol.insert_one(user_det) 43 | except: 44 | return True 45 | pass 46 | 47 | 48 | def addthumb(chat_id, file_id): 49 | dbcol.update_one({"_id": chat_id}, {"$set": {"file_id": file_id}}) 50 | 51 | 52 | def delthumb(chat_id): 53 | dbcol.update_one({"_id": chat_id}, {"$set": {"file_id": None}}) 54 | 55 | 56 | def addcaption(chat_id, caption): 57 | dbcol.update_one({"_id": chat_id}, {"$set": {"caption": caption}}) 58 | 59 | 60 | def delcaption(chat_id): 61 | dbcol.update_one({"_id": chat_id}, {"$set": {"caption": None}}) 62 | 63 | 64 | def dateupdate(chat_id, date): 65 | dbcol.update_one({"_id": chat_id}, {"$set": {"date": date}}) 66 | 67 | 68 | def used_limit(chat_id, used): 69 | dbcol.update_one({"_id": chat_id}, {"$set": {"used_limit": used}}) 70 | 71 | 72 | def usertype(chat_id, type): 73 | dbcol.update_one({"_id": chat_id}, {"$set": {"usertype": type}}) 74 | 75 | 76 | def uploadlimit(chat_id, limit): 77 | dbcol.update_one({"_id": chat_id}, {"$set": {"uploadlimit": limit}}) 78 | 79 | 80 | def addpre(chat_id): 81 | date = add_date() 82 | dbcol.update_one({"_id": chat_id}, {"$set": {"prexdate": date[0]}}) 83 | 84 | 85 | def addpredata(chat_id): 86 | dbcol.update_one({"_id": chat_id}, {"$set": {"prexdate": None}}) 87 | 88 | 89 | def daily(chat_id, date): 90 | dbcol.update_one({"_id": chat_id}, {"$set": {"daily": date}}) 91 | 92 | 93 | def find(chat_id): 94 | id = {"_id": chat_id} 95 | x = dbcol.find(id) 96 | for i in x: 97 | file = i["file_id"] 98 | try: 99 | caption = i["caption"] 100 | except: 101 | caption = None 102 | 103 | return [file, caption] 104 | 105 | 106 | def getid(): 107 | values = [] 108 | for key in dbcol.find(): 109 | id = key["_id"] 110 | values.append((id)) 111 | return values 112 | 113 | def delete(id): 114 | dbcol.delete_one(id) 115 | 116 | 117 | def find_one(id): 118 | return dbcol.find_one({"_id": id}) 119 | 120 | -------------------------------------------------------------------------------- /plugins/admin.py: -------------------------------------------------------------------------------- 1 | from pyrogram.types import ( 2 | InlineKeyboardButton, InlineKeyboardMarkup, ForceReply) 3 | import os, sys, time, asyncio 4 | from pyrogram import Client, filters 5 | from helper.date import add_date 6 | from helper.database import uploadlimit, usertype, addpre 7 | from config import * 8 | 9 | @Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["warn"])) 10 | async def warn(c, m): 11 | if len(m.command) >= 3: 12 | try: 13 | user_id = m.text.split(' ', 2)[1] 14 | reason = m.text.split(' ', 2)[2] 15 | await m.reply_text("User Notfied Sucessfully") 16 | await c.send_message(chat_id=int(user_id), text=reason) 17 | except: 18 | await m.reply_text("User Not Notfied Sucessfully 😔") 19 | 20 | 21 | @Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["addpremium"])) 22 | async def buypremium(bot, message): 23 | await message.reply_text("⊚ ꜱᴇʟᴇᴄᴛ ᴩʟᴀɴ ᴛᴏ ᴜᴩɢʀᴀᴅᴇ...", quote=True, reply_markup=InlineKeyboardMarkup([ 24 | [ 25 | InlineKeyboardButton("🥈 ꜱɪʟᴠᴇʀ", callback_data="vip1") 26 | ], [ 27 | InlineKeyboardButton("🏆 ɢᴏʟᴅ", callback_data="vip2") 28 | ], [ 29 | InlineKeyboardButton("💎 ᴅɪᴀᴍᴏɴᴅ", callback_data="vip3") 30 | ]])) 31 | 32 | 33 | @Client.on_message((filters.channel | filters.private) & filters.user(ADMIN) & filters.command(["ceasepower"])) 34 | async def ceasepremium(bot, message): 35 | await message.reply_text("⊚ ᴩᴏᴡᴇʀ ᴄᴇᴀꜱᴇ ᴍᴏᴅᴇ", quote=True, reply_markup=InlineKeyboardMarkup([ 36 | [InlineKeyboardButton("• ʟɪᴍɪᴛ 500ᴍʙ •", callback_data="cp1"), 37 | InlineKeyboardButton("• ʟɪᴍɪᴛ 100ᴍʙ •", callback_data="cp2") 38 | ], [ 39 | InlineKeyboardButton("• ᴄᴇᴀꜱᴇ ᴀʟʟ ᴩᴏᴡᴇʀ •", callback_data="cp3") 40 | ]])) 41 | 42 | 43 | @Client.on_message((filters.channel | filters.private) & filters.user(ADMIN) & filters.command(["resetpower"])) 44 | async def resetpower(bot, message): 45 | await message.reply_text(text=f"⊚ ᴅᴏ yᴏᴜ ʀᴇᴀʟʟy ᴡᴀɴᴛ ᴛᴏ ʀᴇꜱᴇᴛ ᴅᴀɪʟy ʟɪᴍɪᴛ ᴛᴏ ᴅᴇꜰᴀᴜʟᴛ ᴅᴀᴛᴀ ʟɪᴍɪᴛ 2.0ɢʙ ?",quote=True,reply_markup=InlineKeyboardMarkup([ 46 | [InlineKeyboardButton("• yᴇꜱ ! ꜱᴇᴛ ᴀꜱ ᴅᴇꜰᴀᴜʟᴛ •",callback_data = "dft")], 47 | [InlineKeyboardButton("❌ ᴄᴀɴᴄᴇʟ",callback_data = "cancel")] 48 | ])) 49 | 50 | 51 | @Client.on_callback_query(filters.regex('vip1')) 52 | async def vip1(bot,update): 53 | id = update.message.reply_to_message.text.split("/addpremium") 54 | user_id = id[1].replace(" ", "") 55 | inlimit = 10737418240 56 | uploadlimit(int(user_id),10737418240) 57 | usertype(int(user_id),"🥈 **ꜱɪʟᴠᴇʀ**") 58 | addpre(int(user_id)) 59 | await update.message.edit("ᴀᴅᴅᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy ᴛᴏ ᴩʀᴇᴍɪᴜᴍ ᴜᴩʟᴏᴀᴅ ʟɪᴍɪᴛ 10ɢʙ") 60 | await bot.send_message(user_id,"ʜᴇy yᴏᴜ ᴀʀᴇ ᴜᴩɢʀᴀᴅᴇᴅ ᴛᴏ ꜱɪʟᴠᴇʀ. ᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ /myplan") 61 | await bot.send_message(LOG_CHANNEL,f"⚡️ ᴩʟᴀɴ ᴜᴩɢʀᴀᴅᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy 💥\n\nʜᴇy yᴏᴜ ᴀʀᴇ ᴜᴩɢʀᴀᴅᴇᴅ ᴛᴏ ꜱɪʟᴠᴇʀ. ᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ /myplan") 62 | 63 | @Client.on_callback_query(filters.regex('vip2')) 64 | async def vip2(bot,update): 65 | id = update.message.reply_to_message.text.split("/addpremium") 66 | user_id = id[1].replace(" ", "") 67 | inlimit = 53687091200 68 | uploadlimit(int(user_id), 53687091200) 69 | usertype(int(user_id),"🏆 **ɢᴏʟᴅ**") 70 | addpre(int(user_id)) 71 | await update.message.edit("ᴀᴅᴅᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy ᴛᴏ ᴩʀᴇᴍɪᴜᴍ ᴜᴩʟᴏᴀᴅ ʟɪᴍɪᴛ 50ɢʙ") 72 | await bot.send_message(user_id,"ʜᴇy yᴏᴜ ᴀʀᴇ ᴜᴩɢʀᴀᴅᴇᴅ ᴛᴏ ɢᴏʟᴅ. ᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ /myplan") 73 | 74 | @Client.on_callback_query(filters.regex('vip3')) 75 | async def vip3(bot,update): 76 | id = update.message.reply_to_message.text.split("/addpremium") 77 | user_id = id[1].replace(" ", "") 78 | inlimit = 107374182400 79 | uploadlimit(int(user_id), 107374182400) 80 | usertype(int(user_id),"💎 **ᴅɪᴀᴍᴏɴᴅ**") 81 | addpre(int(user_id)) 82 | await update.message.edit("ᴀᴅᴅᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy ᴛᴏ ᴩʀᴇᴍɪᴜᴍ ᴜᴩʟᴏᴀᴅ ʟɪᴍɪᴛ 100ɢʙ") 83 | await bot.send_message(user_id,"ʜᴇy yᴏᴜ ᴀʀᴇ ᴜᴩɢʀᴀᴅᴇᴅ ᴛᴏ ᴅɪᴀᴍᴏɴᴅ. ᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ /myplan") 84 | 85 | # CEASE POWER MODE @LAZYDEVELOPER 86 | 87 | @Client.on_callback_query(filters.regex('cp1')) 88 | async def cp1(bot,update): 89 | id = update.message.reply_to_message.text.split("/ceasepower") 90 | user_id = id[1].replace(" ", "") 91 | inlimit = 524288000 92 | uploadlimit(int(user_id),524288000) 93 | usertype(int(user_id),"**ᴀᴄᴄᴏᴜɴᴛ ᴅᴏᴡɴɢʀᴀᴅᴇᴅ**") 94 | addpre(int(user_id)) 95 | await update.message.edit("ᴀᴄᴄᴏᴜɴᴛ ᴅᴏᴡɴɢʀᴀᴅᴇᴅ\nᴛʜᴇ ᴜꜱᴇʀ ᴄᴀɴ ᴏɴʟy ᴜꜱᴇ 100ᴍʙ/ᴅᴀy ꜰʀᴏᴍ ᴅᴀᴛᴀ qᴏᴛᴀ") 96 | await bot.send_message(user_id,"⚠️ ᴡᴀʀɴɪɴɢ⚠️\n\n- ᴀᴄᴄᴏᴜɴᴛ ᴅᴏᴡɴɢʀᴀᴅᴇᴅ\nyᴏᴜ ᴄᴀɴ ᴏɴʟy ᴜꜱᴇ 500ᴍʙ/ᴅᴀy ꜰʀᴏᴍ ᴅᴀᴛᴀ qᴏᴛᴀ.\nᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ - /myplan") 97 | 98 | @Client.on_callback_query(filters.regex('cp2')) 99 | async def cp2(bot,update): 100 | id = update.message.reply_to_message.text.split("/ceasepower") 101 | user_id = id[1].replace(" ", "") 102 | inlimit = 104857600 103 | uploadlimit(int(user_id), 104857600) 104 | usertype(int(user_id),"**ᴀᴄᴄᴏᴜɴᴛ ᴅᴏᴡɴɢʀᴀᴅᴇᴅ ʟᴠ-2**") 105 | addpre(int(user_id)) 106 | await update.message.edit("ᴀᴄᴄᴏᴜɴᴛ ᴅᴏᴡɴɢʀᴀᴅᴇᴅ ᴛᴏ ʟᴇᴠᴇʟ 2\nᴛʜᴇ ᴜꜱᴇʀ ᴄᴀɴ ᴏɴʟy ᴜꜱᴇ 100ᴍʙ/ᴅᴀy ꜰʀᴏᴍ ᴅᴀᴛᴀ qᴏᴛᴀ") 107 | await bot.send_message(user_id,"⛔️ ʟᴀꜱᴛ ᴡᴀʀɴɪɴɢ ⛔️\n\n- ᴀᴄᴄᴏᴜɴᴛ ᴅᴏᴡɴɢʀᴀᴅᴇᴅ ᴛᴏ ʟᴇᴠᴇʟ 2\nyᴏᴜ ᴄᴀɴ ᴏɴʟy ᴜꜱᴇ 100ᴍʙ/ᴅᴀy ꜰʀᴏᴍ ᴅᴀᴛᴀ qᴏᴛᴀ.\nᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ - /myplan") 108 | 109 | @Client.on_callback_query(filters.regex('cp3')) 110 | async def cp3(bot,update): 111 | id = update.message.reply_to_message.text.split("/ceasepower") 112 | user_id = id[1].replace(" ", "") 113 | inlimit = 0 114 | uploadlimit(int(user_id), 0) 115 | usertype(int(user_id),"**ᴩᴏᴡᴇʀ ᴄᴇᴀꜱᴇᴅ !**") 116 | addpre(int(user_id)) 117 | await update.message.edit("ᴀʟʟ ᴩᴏᴡᴇʀ ᴄᴇᴀꜱᴇᴅ ꜰʀᴏᴍ ᴛʜᴇ ᴜꜱᴇʀ.\nᴛʜɪꜱ ᴀᴄᴄᴏᴜɴᴛ ʜᴀꜱ 0 ᴍʙ ʀᴇɴᴀᴍɪɴɢ ᴄᴀᴩᴀᴄɪᴛy") 118 | await bot.send_message(user_id,"🚫 ᴀʟʟ ᴩᴏᴡᴇʀ ᴄᴇᴀꜱᴇᴅ 🚫\n\n- ᴀʟʟ ᴩᴏᴡᴇʀ ʜᴀꜱ ʙᴇᴇɴ ᴄᴇᴀꜱᴇᴅ ꜰʀᴏᴍ yᴏᴜ \nꜰʀᴏᴍ ɴᴏᴡ yᴏᴜ ᴄᴀɴ'ᴛ ʀᴇɴᴀᴍ ꜰɪʟᴇꜱ ᴜꜱɪɴɢ ᴍᴇ\nᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ - /myplan") 119 | 120 | @Client.on_callback_query(filters.regex('dft')) 121 | async def dft(bot,update): 122 | id = update.message.reply_to_message.text.split("/resetpower") 123 | user_id = id[1].replace(" ", "") 124 | inlimit = 10 125 | uploadlimit(int(user_id), 10) 126 | usertype(int(user_id),"**ꜰʀᴇᴇ**") 127 | addpre(int(user_id)) 128 | await update.message.edit(" ᴅᴀɪʟy ᴅᴀᴛᴀ ʟɪᴍɪᴛ ʜᴀꜱ ʙᴇᴇɴ ʀᴇꜱᴛ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy.\nᴛʜɪꜱ ᴀᴄᴄᴏᴜɴᴛ ʜᴀꜱ ᴅᴇꜰᴀᴜʟᴛ 10B ʀᴇɴᴀᴍɪɴɢ ᴄᴀᴩᴀᴄɪᴛy ") 129 | await bot.send_message(user_id,"yᴏᴜʀ ᴅᴀɪʟy ᴅᴀᴛᴀ ʟɪᴍɪᴛ ʜᴀꜱ ʙᴇᴇɴ ʀᴇꜱᴇᴛ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟy.\n\nᴄʜᴇᴄᴋ yᴏᴜʀ ᴩʟᴀɴ ʜᴇʀᴇ - /myplan") 130 | 131 | #Restart to cancell all process 132 | @Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["restart"])) 133 | async def restart_bot(b, m): 134 | await m.reply_text("🔄__Rᴇꜱᴛᴀʀᴛɪɴɢ.....__") 135 | os.execl(sys.executable, sys.executable, *sys.argv) 136 | -------------------------------------------------------------------------------- /plugins/start.py: -------------------------------------------------------------------------------- 1 | from datetime import date as date_ 2 | import datetime 3 | import os 4 | from pyrogram.errors.exceptions.bad_request_400 import UserNotParticipant 5 | import time 6 | from pyrogram import Client, filters 7 | from pyrogram.types import ( 8 | InlineKeyboardButton, InlineKeyboardMarkup) 9 | import humanize 10 | from helper.progress import humanbytes 11 | from config import * 12 | from helper.database import insert, find_one, used_limit, usertype, uploadlimit, addpredata, total_rename, total_size 13 | from pyrogram.file_id import FileId 14 | from helper.database import daily as daily_ 15 | from helper.date import check_expi 16 | import os 17 | botid = TOKEN_ONE.split(':')[0] 18 | FLOOD = 500 19 | 20 | 21 | # Part of Day -------------------- 22 | currentTime = datetime.datetime.now() 23 | 24 | if currentTime.hour < 12: 25 | wish = "❤️ GOOD MORNING ❤️" 26 | elif 12 <= currentTime.hour < 12: 27 | wish = '🤍 GOOD AFTERNOON 🤍' 28 | else: 29 | wish = '💙 GOOD EVENING 💙' 30 | 31 | # ------------------------------- 32 | 33 | 34 | @Client.on_message(filters.private & filters.command(["start"])) 35 | async def start(client, message): 36 | old = insert(int(message.chat.id)) 37 | try: 38 | id_one = message.text.split(' ')[1] 39 | except: 40 | txt=f"""**ʜᴇʟʟᴏ - {message.from_user.mention} , \nɪ ᴀᴍ ᴀɴ ᴀᴅᴠᴀɴᴄᴇ ꜰɪʟᴇ ʀᴇɴᴀᴍᴇʀ ᴀɴᴅ ᴄᴏɴᴠᴇʀᴛᴇʀ ʙᴏᴛ ᴡɪᴛʜ ᴘᴇʀᴍᴀɴᴇɴᴛ ᴀɴᴅ ᴄᴜsᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ sᴜᴘᴘᴏʀᴛ. \n\nᴊᴜsᴛ sᴇɴᴅ ᴍᴇ ᴀɴʏ ᴠɪᴅᴇᴏ ᴏʀ ᴅᴏᴄᴜᴍᴇɴᴛ !!**""" 41 | await message.reply_photo(photo=LAZY_PIC, 42 | caption=txt, 43 | reply_markup=InlineKeyboardMarkup( 44 | [[InlineKeyboardButton("Pʀᴇᴍɪᴜᴍ Pʟᴀɴꜱ",callback_data = "upgrade")], 45 | [InlineKeyboardButton("Cʜᴀɴɴᴇʟ", url=f'https://t.me/{UPDATES_CHANNEL}'), 46 | InlineKeyboardButton("Cᴏɴᴛᴀᴄᴛ Uꜱ", url=f'https://t.me/{SUPPORT_GROUP}')], 47 | [InlineKeyboardButton("• Hᴇʟᴩ •",callback_data = "help")] 48 | ])) 49 | return 50 | if id_one: 51 | if old == True: 52 | try: 53 | await client.send_message(id_one, "Your Friend is Already Using Our Bot") 54 | await message.reply_photo(photo=LAZY_PIC, 55 | caption=txt, 56 | reply_markup=InlineKeyboardMarkup( 57 | [[InlineKeyboardButton("Pʀᴇᴍɪᴜᴍ Pʟᴀɴꜱ",callback_data = "upgrade")], 58 | [InlineKeyboardButton("Cʜᴀɴɴᴇʟ", url=f'https://t.me/{UPDATES_CHANNEL}'), 59 | InlineKeyboardButton("Cᴏɴᴛᴀᴄᴛ Uꜱ", url=f'https://t.me/{SUPPORT_GROUP}')], 60 | [InlineKeyboardButton("• Hᴇʟᴩ •",callback_data = "help")] 61 | ])) 62 | except: 63 | return 64 | else: 65 | await client.send_message(id_one, "Congrats! You Won 100MB Upload limit") 66 | _user_ = find_one(int(id_one)) 67 | limit = _user_["uploadlimit"] 68 | new_limit = limit + 104857600 69 | uploadlimit(int(id_one), new_limit) 70 | await message.reply_text(text=f"""** 71 | ʜᴇʟʟᴏ - {message.from_user.mention} , \nɪ ᴀᴍ ᴀɴ ᴀᴅᴠᴀɴᴄᴇ ꜰɪʟᴇ ʀᴇɴᴀᴍᴇʀ ᴀɴᴅ ᴄᴏɴᴠᴇʀᴛᴇʀ ʙᴏᴛ ᴡɪᴛʜ ᴘᴇʀᴍᴀɴᴇɴᴛ ᴀɴᴅ ᴄᴜsᴛᴏᴍ ᴛʜᴜᴍʙɴᴀɪʟ sᴜᴘᴘᴏʀᴛ. \n\nᴊᴜsᴛ sᴇɴᴅ ᴍᴇ ᴀɴʏ ᴠɪᴅᴇᴏ ᴏʀ ᴅᴏᴄᴜᴍᴇɴᴛ !!** 72 | """, reply_to_message_id=message.id, 73 | reply_markup=InlineKeyboardMarkup( 74 | [[InlineKeyboardButton("Pʀᴇᴍɪᴜᴍ Pʟᴀɴꜱ",callback_data = "upgrade")], 75 | [InlineKeyboardButton("Cʜᴀɴɴᴇʟ", url=f'https://t.me/{UPDATES_CHANNEL}'), 76 | InlineKeyboardButton("Cᴏɴᴛᴀᴄᴛ Uꜱ", url=f'https://t.me/{SUPPORT_GROUP}')], 77 | [InlineKeyboardButton("• Hᴇʟᴩ •",callback_data = "help")] 78 | ])) 79 | 80 | 81 | @Client.on_message((filters.private & (filters.document | filters.audio | filters.video)) | filters.channel & (filters.document | filters.audio | filters.video)) 82 | async def send_doc(client,message): 83 | update_channel = CHANNEL 84 | user_id = message.from_user.id 85 | if update_channel : 86 | try: 87 | await client.get_chat_member(update_channel, user_id) 88 | except UserNotParticipant: 89 | _newus = find_one(message.from_user.id) 90 | user = _newus["usertype"] 91 | await message.reply_text("**ᴅᴜᴇ ᴛᴏ ᴏᴠᴇʀʟᴏᴀᴅ, ᴏɴʟʏ ᴄʜᴀɴɴᴇʟ ᴍᴇᴍʙᴇʀꜱ ᴄᴀɴ ᴜꜱᴇ ᴍᴇ.**", 92 | reply_to_message_id=message.id, 93 | reply_markup=InlineKeyboardMarkup( 94 | [[InlineKeyboardButton("❆ ᴊᴏɪɴ ᴏᴜʀ ʙᴀᴄᴋ-ᴜᴩ ᴄʜᴀɴɴᴇʟ ❆", url=f"https://t.me/{update_channel}")]])) 95 | await client.send_message(log_channel,f"🦋 #ReName_MsBot 🦋,\n\n**ID** : `{user_id}`\n**Name**: {message.from_user.mention} {message.from_user.last_name}\n**User-Plan** : {user}\n\n ", 96 | reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("🔺 Restrict User ( **pm** ) 🔺", callback_data="ceasepower")]])) 97 | return 98 | 99 | try: 100 | bot_data = find_one(int(botid)) 101 | prrename = bot_data['total_rename'] 102 | prsize = bot_data['total_size'] 103 | user_deta = find_one(user_id) 104 | except: 105 | await message.reply_text("ᴜꜱᴇ ᴄᴍᴅ ꜰɪʀꜱᴛ /myplan") 106 | try: 107 | used_date = user_deta["date"] 108 | buy_date = user_deta["prexdate"] 109 | daily = user_deta["daily"] 110 | user_type = user_deta["usertype"] 111 | except: 112 | await message.reply_text(text=f"**ʜᴇʟʟᴏ {message.from_user.mention} , \n\nꜱᴏʀʀy ꜰᴏʀ ᴛʜɪꜱ ɪꜱꜱᴜᴇ \nᴡᴇ ᴀʀᴇ ᴄᴜʀʀᴇɴᴛʟy ᴡᴏʀᴋɪɴɢ ᴏɴ ᴛʜɪꜱ ɪꜱꜱᴜᴇ \nᴩʟᴇᴀꜱᴇ ʙᴜy ᴩʀᴇᴍɪᴜᴍ ᴏʀ ʀᴇꜱᴛᴀʀᴛ ʙᴏᴛ \n\nᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ - /restart**", 113 | reply_markup=InlineKeyboardMarkup( 114 | [[InlineKeyboardButton("Pʀᴇᴍɪᴜᴍ Pʟᴀɴꜱ",callback_data = "upgrade")], 115 | [InlineKeyboardButton("Cʜᴀɴɴᴇʟ", url=f'https://t.me/{UPDATES_CHANNEL}'), 116 | InlineKeyboardButton("Cᴏɴᴛᴀᴄᴛ Uꜱ", url=f'https://t.me/{SUPPORT_GROUP}')], 117 | [InlineKeyboardButton("• Hᴇʟᴩ •",callback_data = "help")] 118 | ])) 119 | await message.reply_text(text=f"🦋") 120 | return 121 | 122 | c_time = time.time() 123 | 124 | if user_type == "free": 125 | LIMIT = 600 126 | else: 127 | LIMIT = 30 128 | then = used_date + LIMIT 129 | left = round(then - c_time) 130 | conversion = datetime.timedelta(seconds=left) 131 | ltime = str(conversion) 132 | if left > 0: 133 | await message.reply_text(f"```ꜱᴏʀʀy ᴅᴜᴅᴇ ɪ ᴀᴍ ɴᴏᴛ ᴏɴʟy ꜰᴏʀ yᴏᴜ \n ꜰʟᴏᴏᴅ ᴄᴏɴᴛʀᴏʟ ɪꜱ ᴀᴄᴛɪᴠᴇ ꜱᴏ ᴩʟᴇᴀꜱᴇ ᴡᴀɪᴛ ꜰᴏʀ``` **{ltime}**", reply_to_message_id=message.id) 134 | else: 135 | # Forward a single message 136 | media = await client.get_messages(message.chat.id, message.id) 137 | file = media.document or media.video or media.audio 138 | dcid = FileId.decode(file.file_id).dc_id 139 | filename = file.file_name 140 | value = 2147483648 141 | used_ = find_one(message.from_user.id) 142 | used = used_["used_limit"] 143 | limit = used_["uploadlimit"] 144 | expi = daily - \ 145 | int(time.mktime(time.strptime(str(date_.today()), '%Y-%m-%d'))) 146 | if expi != 0: 147 | today = date_.today() 148 | pattern = '%Y-%m-%d' 149 | epcho = int(time.mktime(time.strptime(str(today), pattern))) 150 | daily_(message.from_user.id, epcho) 151 | used_limit(message.from_user.id, 0) 152 | remain = limit - used 153 | if remain < int(file.file_size): 154 | await message.reply_text(f"100% ᴏꜰ ᴅᴀɪʟy {humanbytes(limit)} ᴅᴀᴛᴀ qᴜᴏᴛᴀ ᴇxʜᴀᴜꜱᴛᴇᴅ.\n\n ꜰɪʟᴇ ꜱɪᴢᴇ ᴅᴇᴛᴇꜱᴛᴇᴅ {humanbytes(file.file_size)}\n ᴜꜱᴇᴅ ᴅᴀɪʟy ʟɪᴍɪᴛ {humanbytes(used)}\n\nyᴏᴜ ʜᴀᴠᴇ ᴏɴʟy **{humanbytes(remain)}** ʟᴇꜰᴛ ᴏɴ yᴏᴜʀ ᴀᴄᴄᴏᴜɴᴛ.\nɪꜰ yᴏᴜ ᴡᴀɴᴛ ᴛᴏ ʀᴇɴᴀᴍᴇ ʟᴀʀɢᴇ ꜰɪʟᴇ ᴜᴩɢʀᴀᴅᴇ yᴏᴜʀ ᴩʟᴀɴ ", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ", callback_data="upgrade")]])) 155 | return 156 | if value < file.file_size: 157 | 158 | if STRING: 159 | if buy_date == None: 160 | await message.reply_text(f" **yᴏᴜ ᴄᴀɴ'ᴛ ᴜᴩʟᴏᴀᴅ ᴍᴏʀᴇ ᴛʜᴇɴ {humanbytes(limit)} ᴜꜱᴇᴅ ᴅᴀɪʟy ʟɪᴍɪᴛ** {humanbytes(used)} ", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("💳 ᴜᴩɢʀᴀᴅᴇ", callback_data="upgrade")]])) 161 | return 162 | pre_check = check_expi(buy_date) 163 | if pre_check == True: 164 | await message.reply_text(f"""**__𝑊ℎ𝑎𝑡 𝑑𝑜 𝑦𝑜𝑢 𝑤𝑎𝑛𝑡 𝑚𝑒 𝑡𝑜 𝑑𝑜 𝑤𝑖𝑡ℎ 𝑡ℎ𝑖𝑠 𝑓𝑖𝑙𝑒...?__**\n**__𝑂𝑙𝑑 𝐹𝑖𝑙𝑒𝑁𝑎𝑚𝑒__** :- {filename}\n**__𝐹𝑖𝑙𝑒 𝑆𝑖𝑧𝑒__** :- {humanize.naturalsize(file.file_size)}\n**__𝐷𝐶 𝐼𝐷__** :- {dcid}""", reply_to_message_id=message.id, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("✍ ʀᴇɴᴀᴍᴇ", callback_data="rename"), InlineKeyboardButton("✖️ ᴄᴀɴᴄᴇʟ", callback_data="cancel")]])) 165 | total_rename(int(botid), prrename) 166 | total_size(int(botid), prsize, file.file_size) 167 | else: 168 | uploadlimit(message.from_user.id, 2147483648) 169 | usertype(message.from_user.id, "Free") 170 | 171 | await message.reply_text(f'**yᴏᴜʀ ᴩʟᴀɴ ᴇxᴩɪʀᴇᴅ ᴏɴ {buy_date}', quote=True) 172 | return 173 | else: 174 | await message.reply_text("**ᴜᴩɢʀᴀᴅᴇ yᴏᴜʀ ᴩʟᴀɴ ᴛᴏ ʀᴇɴᴀᴍᴇ ꜰɪʟᴇꜱ ʟᴀʀɢᴇʀ ᴛʜᴀɴ 2ɢʙ**") 175 | return 176 | else: 177 | if buy_date: 178 | pre_check = check_expi(buy_date) 179 | if pre_check == False: 180 | uploadlimit(message.from_user.id, 2147483648) 181 | usertype(message.from_user.id, "Free") 182 | 183 | filesize = humanize.naturalsize(file.file_size) 184 | fileid = file.file_id 185 | total_rename(int(botid), prrename) 186 | total_size(int(botid), prsize, file.file_size) 187 | await message.reply_text(f"""**__𝑊ℎ𝑎𝑡 𝑑𝑜 𝑦𝑜𝑢 𝑤𝑎𝑛𝑡 𝑚𝑒 𝑡𝑜 𝑑𝑜 𝑤𝑖𝑡ℎ 𝑡ℎ𝑖𝑠 𝑓𝑖𝑙𝑒...?__**\n**__𝑂𝑙𝑑 𝐹𝑖𝑙𝑒𝑁𝑎𝑚𝑒__** :- {filename}\n**__𝐹𝑖𝑙𝑒 𝑆𝑖𝑧𝑒__** :- {filesize}\n**__𝐷𝐶 𝐼𝐷__** :- {dcid}""", reply_to_message_id=message.id, reply_markup=InlineKeyboardMarkup( 188 | [[InlineKeyboardButton("✍ ʀᴇɴᴀᴍᴇ", callback_data="rename"), 189 | InlineKeyboardButton("✖️ ᴄᴀɴᴄᴇʟ", callback_data="cancel")]])) 190 | -------------------------------------------------------------------------------- /plugins/cb_data.py: -------------------------------------------------------------------------------- 1 | from helper.progress import progress_for_pyrogram, TimeFormatter 2 | 3 | from pyrogram import Client, filters 4 | from pyrogram.types import ( 5 | InlineKeyboardButton, InlineKeyboardMarkup, ForceReply) 6 | from hachoir.metadata import extractMetadata 7 | from hachoir.parser import createParser 8 | from helper.database import * 9 | import os 10 | import random 11 | from PIL import Image 12 | import time 13 | from datetime import timedelta 14 | from helper.ffmpeg import take_screen_shot, fix_thumb 15 | from helper.progress import humanbytes 16 | from helper.set import escape_invalid_curly_brackets 17 | import os 18 | from config import * 19 | 20 | app = Client("test", api_id=API_ID, api_hash=API_HASH, session_string=STRING) 21 | 22 | 23 | @Client.on_callback_query(filters.regex('cancel')) 24 | async def cancel(bot, update): 25 | try: 26 | await update.message.delete() 27 | except: 28 | return 29 | 30 | 31 | @Client.on_callback_query(filters.regex('rename')) 32 | async def rename(bot, update): 33 | date_fa = str(update.message.date) 34 | pattern = '%Y-%m-%d %H:%M:%S' 35 | date = int(time.mktime(time.strptime(date_fa, pattern))) 36 | chat_id = update.message.chat.id 37 | id = update.message.reply_to_message_id 38 | await update.message.delete() 39 | await update.message.reply_text(f"**__𝑃𝑙𝑒𝑎𝑠𝑒 𝐸𝑛𝑡𝑒𝑟 𝑁𝑒𝑤 𝐹𝑖𝑙𝑒𝑁𝑎𝑚𝑒.....__***", reply_to_message_id=id, 40 | reply_markup=ForceReply(True)) 41 | dateupdate(chat_id, date) 42 | 43 | 44 | @Client.on_callback_query(filters.regex("doc")) 45 | async def doc(bot, update): 46 | new_name = update.message.text 47 | used_ = find_one(update.from_user.id) 48 | used = used_["used_limit"] 49 | date = used_["date"] 50 | name = new_name.split(":-") 51 | new_filename = name[1] 52 | file_path = f"downloads/{new_filename}" 53 | message = update.message.reply_to_message 54 | file = message.document or message.video or message.audio 55 | ms = await update.message.edit("```Trying To Download...```") 56 | used_limit(update.from_user.id, file.file_size) 57 | c_time = time.time() 58 | total_used = used + int(file.file_size) 59 | used_limit(update.from_user.id, total_used) 60 | try: 61 | path = await bot.download_media(message=file, progress=progress_for_pyrogram, progress_args=("``` Trying To Download...```", ms, c_time)) 62 | 63 | except Exception as e: 64 | neg_used = used - int(file.file_size) 65 | used_limit(update.from_user.id, neg_used) 66 | await ms.edit(e) 67 | return 68 | splitpath = path.split("/downloads/") 69 | dow_file_name = splitpath[1] 70 | old_file_name = f"downloads/{dow_file_name}" 71 | os.rename(old_file_name, file_path) 72 | user_id = int(update.message.chat.id) 73 | data = find(user_id) 74 | try: 75 | c_caption = data[1] 76 | except: 77 | pass 78 | thumb = data[0] 79 | if c_caption: 80 | doc_list = ["filename", "filesize"] 81 | new_tex = escape_invalid_curly_brackets(c_caption, doc_list) 82 | caption = new_tex.format( 83 | filename=new_filename, filesize=humanbytes(file.file_size)) 84 | else: 85 | caption = f"**{new_filename}**" 86 | if thumb: 87 | ph_path = await bot.download_media(thumb) 88 | Image.open(ph_path).convert("RGB").save(ph_path) 89 | img = Image.open(ph_path) 90 | img.resize((320, 320)) 91 | img.save(ph_path, "JPEG") 92 | c_time = time.time() 93 | 94 | else: 95 | ph_path = None 96 | 97 | value = 2090000000 98 | if value < file.file_size: 99 | await ms.edit("```Trying To Upload```") 100 | try: 101 | filw = await app.send_document(LOG_CHANNEL, document=file_path, thumb=ph_path, caption=caption, progress=progress_for_pyrogram, progress_args=("```Trying To Uploading```", ms, c_time)) 102 | from_chat = filw.chat.id 103 | mg_id = filw.id 104 | time.sleep(2) 105 | await bot.copy_message(update.from_user.id, from_chat, mg_id) 106 | await ms.delete() 107 | os.remove(file_path) 108 | try: 109 | os.remove(ph_path) 110 | except: 111 | pass 112 | except Exception as e: 113 | neg_used = used - int(file.file_size) 114 | used_limit(update.from_user.id, neg_used) 115 | await ms.edit(e) 116 | os.remove(file_path) 117 | try: 118 | os.remove(ph_path) 119 | except: 120 | return 121 | else: 122 | await ms.edit("```Trying To Upload```") 123 | c_time = time.time() 124 | try: 125 | await bot.send_document(update.from_user.id, document=file_path, thumb=ph_path, caption=caption, progress=progress_for_pyrogram, progress_args=("```Trying To Uploading```", ms, c_time)) 126 | await ms.delete() 127 | os.remove(file_path) 128 | except Exception as e: 129 | neg_used = used - int(file.file_size) 130 | used_limit(update.from_user.id, neg_used) 131 | await ms.edit(e) 132 | os.remove(file_path) 133 | return 134 | 135 | 136 | @Client.on_callback_query(filters.regex("vid")) 137 | async def vid(bot, update): 138 | new_name = update.message.text 139 | used_ = find_one(update.from_user.id) 140 | used = used_["used_limit"] 141 | date = used_["date"] 142 | name = new_name.split(":-") 143 | new_filename = name[1] 144 | file_path = f"downloads/{new_filename}" 145 | message = update.message.reply_to_message 146 | file = message.document or message.video or message.audio 147 | ms = await update.message.edit("```Trying To Download...```") 148 | used_limit(update.from_user.id, file.file_size) 149 | c_time = time.time() 150 | total_used = used + int(file.file_size) 151 | used_limit(update.from_user.id, total_used) 152 | try: 153 | path = await bot.download_media(message=file, progress=progress_for_pyrogram, progress_args=("``` Trying To Download...```", ms, c_time)) 154 | 155 | except Exception as e: 156 | neg_used = used - int(file.file_size) 157 | used_limit(update.from_user.id, neg_used) 158 | await ms.edit(e) 159 | return 160 | splitpath = path.split("/downloads/") 161 | dow_file_name = splitpath[1] 162 | old_file_name = f"downloads/{dow_file_name}" 163 | os.rename(old_file_name, file_path) 164 | user_id = int(update.message.chat.id) 165 | data = find(user_id) 166 | try: 167 | c_caption = data[1] 168 | except: 169 | pass 170 | thumb = data[0] 171 | 172 | duration = 0 173 | metadata = extractMetadata(createParser(file_path)) 174 | if metadata.has("duration"): 175 | duration = metadata.get('duration').seconds 176 | if c_caption: 177 | vid_list = ["filename", "filesize", "duration"] 178 | new_tex = escape_invalid_curly_brackets(c_caption, vid_list) 179 | caption = new_tex.format(filename=new_filename, filesize=humanbytes( 180 | file.file_size), duration=timedelta(seconds=duration)) 181 | else: 182 | caption = f"**{new_filename}**" 183 | if thumb: 184 | ph_path = await bot.download_media(thumb) 185 | Image.open(ph_path).convert("RGB").save(ph_path) 186 | img = Image.open(ph_path) 187 | img.resize((320, 320)) 188 | img.save(ph_path, "JPEG") 189 | c_time = time.time() 190 | 191 | else: 192 | try: 193 | ph_path_ = await take_screen_shot(file_path, os.path.dirname(os.path.abspath(file_path)), random.randint(0, duration - 1)) 194 | width, height, ph_path = await fix_thumb(ph_path_) 195 | except Exception as e: 196 | ph_path = None 197 | print(e) 198 | 199 | value = 2090000000 200 | if value < file.file_size: 201 | await ms.edit("```Trying To Upload```") 202 | try: 203 | filw = await app.send_video(LOG_CHANNEL, video=file_path, thumb=ph_path, duration=duration, caption=caption, progress=progress_for_pyrogram, progress_args=("```Trying To Uploading```", ms, c_time)) 204 | from_chat = filw.chat.id 205 | mg_id = filw.id 206 | time.sleep(2) 207 | await bot.copy_message(update.from_user.id, from_chat, mg_id) 208 | await ms.delete() 209 | os.remove(file_path) 210 | try: 211 | os.remove(ph_path) 212 | except: 213 | pass 214 | except Exception as e: 215 | neg_used = used - int(file.file_size) 216 | used_limit(update.from_user.id, neg_used) 217 | await ms.edit(e) 218 | os.remove(file_path) 219 | try: 220 | os.remove(ph_path) 221 | except: 222 | return 223 | else: 224 | await ms.edit("```Trying To Upload```") 225 | c_time = time.time() 226 | try: 227 | await bot.send_video(update.from_user.id, video=file_path, thumb=ph_path, duration=duration, caption=caption, progress=progress_for_pyrogram, progress_args=("```Trying To Uploading```", ms, c_time)) 228 | await ms.delete() 229 | os.remove(file_path) 230 | except Exception as e: 231 | neg_used = used - int(file.file_size) 232 | used_limit(update.from_user.id, neg_used) 233 | await ms.edit(e) 234 | os.remove(file_path) 235 | return 236 | 237 | 238 | @Client.on_callback_query(filters.regex("aud")) 239 | async def aud(bot, update): 240 | new_name = update.message.text 241 | used_ = find_one(update.from_user.id) 242 | used = used_["used_limit"] 243 | name = new_name.split(":-") 244 | new_filename = name[1] 245 | file_path = f"downloads/{new_filename}" 246 | message = update.message.reply_to_message 247 | file = message.document or message.video or message.audio 248 | total_used = used + int(file.file_size) 249 | used_limit(update.from_user.id, total_used) 250 | ms = await update.message.edit("```Trying To Download...```") 251 | c_time = time.time() 252 | try: 253 | path = await bot.download_media(message=file, progress=progress_for_pyrogram, progress_args=("``` Trying To Download...```", ms, c_time)) 254 | except Exception as e: 255 | neg_used = used - int(file.file_size) 256 | used_limit(update.from_user.id, neg_used) 257 | await ms.edit(e) 258 | return 259 | splitpath = path.split("/downloads/") 260 | dow_file_name = splitpath[1] 261 | old_file_name = f"downloads/{dow_file_name}" 262 | os.rename(old_file_name, file_path) 263 | duration = 0 264 | metadata = extractMetadata(createParser(file_path)) 265 | if metadata.has("duration"): 266 | duration = metadata.get('duration').seconds 267 | user_id = int(update.message.chat.id) 268 | data = find(user_id) 269 | c_caption = data[1] 270 | thumb = data[0] 271 | if c_caption: 272 | aud_list = ["filename", "filesize", "duration"] 273 | new_tex = escape_invalid_curly_brackets(c_caption, aud_list) 274 | caption = new_tex.format(filename=new_filename, filesize=humanbytes( 275 | file.file_size), duration=timedelta(seconds=duration)) 276 | else: 277 | caption = f"**{new_filename}**" 278 | 279 | if thumb: 280 | ph_path = await bot.download_media(thumb) 281 | Image.open(ph_path).convert("RGB").save(ph_path) 282 | img = Image.open(ph_path) 283 | img.resize((320, 320)) 284 | img.save(ph_path, "JPEG") 285 | await ms.edit("```Trying To Upload```") 286 | c_time = time.time() 287 | try: 288 | await bot.send_audio(update.message.chat.id, audio=file_path, caption=caption, thumb=ph_path, duration=duration, progress=progress_for_pyrogram, progress_args=("```Trying To Uploading```", ms, c_time)) 289 | await ms.delete() 290 | os.remove(file_path) 291 | os.remove(ph_path) 292 | except Exception as e: 293 | neg_used = used - int(file.file_size) 294 | used_limit(update.from_user.id, neg_used) 295 | await ms.edit(e) 296 | os.remove(file_path) 297 | os.remove(ph_path) 298 | else: 299 | await ms.edit("```Trying To Upload```") 300 | c_time = time.time() 301 | try: 302 | await bot.send_audio(update.message.chat.id, audio=file_path, caption=caption, duration=duration, progress=progress_for_pyrogram, progress_args=("```Trying To Uploading```", ms, c_time)) 303 | await ms.delete() 304 | os.remove(file_path) 305 | except Exception as e: 306 | await ms.edit(e) 307 | neg_used = used - int(file.file_size) 308 | used_limit(update.from_user.id, neg_used) 309 | os.remove(file_path) 310 | 311 | 312 | # 313 | # LazyDeveloperr 314 | # 315 | --------------------------------------------------------------------------------