-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrename.py
More file actions
26 lines (24 loc) 路 1.27 KB
/
Copy pathrename.py
File metadata and controls
26 lines (24 loc) 路 1.27 KB
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
from asyncio import sleep
from plugins.Extra.rename.filedetect import refunc
from pyrogram import Client, filters, enums
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, ForceReply, CallbackQuery
from pyrogram.errors import FloodWait
from info import RENAME_MODE
import humanize
import random
@Client.on_message(filters.private & filters.command("rename"))
async def rename_start(client, message):
if RENAME_MODE == False:
return
msg = await client.ask(message.chat.id, "**Now send me your file/video/audio to rename.**")
if not msg.media:
return await message.reply("**Please send me supported media.**")
if msg.media in [enums.MessageMediaType.VIDEO, enums.MessageMediaType.DOCUMENT, enums.MessageMediaType.AUDIO]:
file = getattr(msg, msg.media.value)
filename = file.file_name
filesize = humanize.naturalsize(file.file_size)
fileid = file.file_id
text = f"""**__饾櫩饾殨饾殠饾殜饾殰饾殠 饾櫞饾殫饾殱饾殠饾殯 饾櫧饾殠饾殸 饾櫟饾殥饾殨饾殠饾櫧饾殜饾殩饾殠...__**\n\n**Original File Name** :- `{filename}`\n\n**Original File Size** :- `{filesize}`"""
await message.reply_text(text)
kk = await client.listen(message.from_user.id)
await refunc(client, message, kk.text, msg)