__version__ = (1, 0, 0)
# ▀█▀ █ █ █▀█ █▀▄▀█ ▄▀█ █▀
# █ █▀█ █▄█ █ ▀ █ █▀█ ▄█
# https://t.me/netuzb
#
# 🔒 Licensed under the GNU AGPLv3
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
# meta pic: https://te.legra.ph/file/a2c350d63b964fa70903c.png
# meta banner: https://te.legra.ph/file/9adde024646b7662f12fe.jpg
# meta developer: @wilsonmods
# scope: hikka_only
# scope: hikka_min 1.3.2
import asyncio
import logging
from telethon.tl.types import DocumentAttributeFilename
from .. import loader, utils
wilson_fire = "🔥 "
wilson_warn = "🚨 "
wilson_wait = "🕒 "
wilson_done = "✅ "
class ReanemerMod(loader.Module):
"""Rename file name"""
strings = {
"name": "✍️ Fast-Rename",
"wilson_no_reply": wilson_warn + "Reply to file?",
"wilson_no_name": wilson_fire + "What's the name?",
"wilson_wait": wilson_wait + "Please, wait...",
"wilson_load": wilson_fire + "Loading »»",
"wilson_down": wilson_fire + "Downloading »»",
"wilson_done": wilson_done + "Done",
}
strings_ru = {
"wilson_no_reply": wilson_warn + "А ответ на файл?",
"wilson_no_name": wilson_fire + "Как назвать?",
"wilson_wait": wilson_wait + "Пожалуйста, подождите...",
"wilson_load": wilson_fire + "Загрузка »»",
"wilson_down": wilson_fire + "Скачивание »»",
"wilson_done": wilson_done + "Готов",
}
strings_uz = {
"wilson_no_reply": wilson_warn + "Faylga javob tariqasida?",
"wilson_no_name": wilson_fire + "Qanday nom?",
"wilson_wait": wilson_wait + "Iltimos, kuting...",
"wilson_load": wilson_fire + "Yuborilmoqda »»",
"wilson_down": wilson_fire + "Yuklanmoqda »»",
"wilson_done": wilson_done + "Tayyor",
}
async def renamecmd(self, message):
"""> rename [name.format]"""
await message.edit(f"{self.strings('wilson_wait')}")
reply = await message.get_reply_message()
if not reply or not reply.file:
await message.edit(self.strings["wilson_no_reply"])
return
name = utils.get_args_raw(message)
if not name:
await message.edit(self.strings["wilson_no_name"])
return
fn = reply.file.name
if not fn:
fn = ""
fs = reply.file.size
[await message.edit(f"{self.strings('wilson_down')} {fn}") if fs > 500000 else ...]
file = await reply.download_media(bytes)
[await message.edit(f"{self.strings('wilson_load')} {name}") if fs > 500000 else ...]
await message.client.send_file(message.to_id, file, force_document=True, reply_to=reply, attributes=[DocumentAttributeFilename(file_name=name)], caption=f"{self.strings('wilson_done')} | {name}")
await message.delete()