diff --git a/modules/upl.py b/modules/upl.py
index 285aff6..511c324 100644
--- a/modules/upl.py
+++ b/modules/upl.py
@@ -15,12 +15,13 @@
# along with this program. If not, see .
import os
+import time
from pyrogram import Client, filters
from pyrogram.types import Message
from utils.misc import modules_help, prefix
-from utils.scripts import format_exc
+from utils.scripts import format_exc, progress
@Client.on_message(filters.command("upl", prefix) & filters.me)
@@ -44,7 +45,12 @@ async def upl(client: Client, message: Message):
try:
await message.edit("Uploading Now...")
- await client.send_document(message.chat.id, link)
+ await client.send_document(
+ message.chat.id,
+ link,
+ progress=progress,
+ progress_args=(message, time.time(), "Uploading Now...", link),
+ )
await message.delete()
except Exception as e:
await message.edit(format_exc(e))
@@ -53,7 +59,11 @@ async def upl(client: Client, message: Message):
@Client.on_message(filters.command("dlf", prefix) & filters.me)
async def dlf(client: Client, message: Message):
if message.reply_to_message:
- await client.download_media(message.reply_to_message)
+ await client.download_media(
+ message.reply_to_message,
+ progress=progress,
+ progress_args=(message, time.time(), "Uploading Now..."),
+ )
await message.edit("Downloaded Successfully!")
else:
await message.edit(f"Usage: {prefix}dlf [reply to a file]")
@@ -65,7 +75,12 @@ async def mupl(client: Client, message: Message):
try:
if os.path.exists(link):
await message.edit("Uploading Now...")
- await client.send_document(message.chat.id, link)
+ await client.send_document(
+ message.chat.id,
+ link,
+ progress=progress,
+ progress_args=(message, time.time(), "Uploading Now..."),
+ )
await message.delete()
return await message.edit("Error: LOGS file doesn't exist.")
except Exception as e:
@@ -93,7 +108,12 @@ async def uplr(client: Client, message: Message):
try:
await message.edit("Uploading Now...")
- await client.send_document(message.chat.id, link)
+ await client.send_document(
+ message.chat.id,
+ link,
+ progress=progress,
+ progress_args=(message, time.time(), "Uploading Now...", link),
+ )
await message.delete()
except Exception as e:
await message.edit(format_exc(e))
diff --git a/utils/scripts.py b/utils/scripts.py
index 61aeed5..3bf30c9 100644
--- a/utils/scripts.py
+++ b/utils/scripts.py
@@ -132,8 +132,7 @@ async def progress(current, total, message, start, type_of_ps, file_name=None):
if file_name:
try:
await message.edit(
- f"{type_of_ps}\n**File Name:** `{file_name}`\n{tmp}",
- parse_mode=enums.ParseMode.MARKDOWN,
+ f"{type_of_ps}\nFile Name: {file_name}\n{tmp}"
)
except FloodWait as e:
await asyncio.sleep(e.x)
@@ -141,9 +140,7 @@ async def progress(current, total, message, start, type_of_ps, file_name=None):
pass
else:
try:
- await message.edit(
- f"{type_of_ps}\n{tmp}", parse_mode=enums.ParseMode.MARKDOWN
- )
+ await message.edit(f"{type_of_ps}\n{tmp}")
except FloodWait as e:
await asyncio.sleep(e.x)
except MessageNotModified: