Spaces:
Runtime error
Runtime error
Jishu Developer
commited on
Update start.py
Browse files- plugins/start.py +9 -19
plugins/start.py
CHANGED
@@ -90,17 +90,7 @@ async def start_command(client: Client, message: Message):
|
|
90 |
|
91 |
|
92 |
k = await client.send_message(chat_id = message.from_user.id, text=f"<b>βοΈ <u>IMPORTANT</u> βοΈ</b>\n\nThis Video / File Will Be Deleted In {file_auto_delete} (Due To Copyright Issues).\n\nπ Please Forward This Video / File To Somewhere Else And Start Downloading There.")
|
93 |
-
|
94 |
-
await asyncio.sleep(FILE_AUTO_DELETE)
|
95 |
-
|
96 |
-
for msg in messages:
|
97 |
-
try:
|
98 |
-
asyncio.create_task
|
99 |
-
await client.delete_messages(chat_id=msg.chat.id, message_ids=[msg.id])
|
100 |
-
except Exception as e:
|
101 |
-
print(f"The attempt to delete the media {msg.id} was unsuccessful: {e}")
|
102 |
-
|
103 |
-
await k.edit_text("Your Video / File Is Successfully Deleted β
")
|
104 |
|
105 |
# for madflix_msg in madflix_msgs:
|
106 |
# try:
|
@@ -233,15 +223,15 @@ async def send_text(client: Bot, message: Message):
|
|
233 |
|
234 |
|
235 |
# Function to handle file deletion
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
# await client.send_message(messages[0].chat.id, "Your Video / File Is Successfully Deleted β
")
|
244 |
-
|
245 |
|
246 |
|
247 |
|
|
|
90 |
|
91 |
|
92 |
k = await client.send_message(chat_id = message.from_user.id, text=f"<b>βοΈ <u>IMPORTANT</u> βοΈ</b>\n\nThis Video / File Will Be Deleted In {file_auto_delete} (Due To Copyright Issues).\n\nπ Please Forward This Video / File To Somewhere Else And Start Downloading There.")
|
93 |
+
asyncio.create_task(delete_files(madflix_msgs, client))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
# for madflix_msg in madflix_msgs:
|
96 |
# try:
|
|
|
223 |
|
224 |
|
225 |
# Function to handle file deletion
|
226 |
+
async def delete_files(messages, client, k):
|
227 |
+
await asyncio.sleep(FILE_AUTO_DELETE) # Wait for the duration specified in config.py
|
228 |
+
for msg in messages:
|
229 |
+
try:
|
230 |
+
await client.delete_messages(chat_id=msg.chat.id, message_ids=[msg.id])
|
231 |
+
except Exception as e:
|
232 |
+
print(f"The attempt to delete the media {msg.id} was unsuccessful: {e}")
|
233 |
# await client.send_message(messages[0].chat.id, "Your Video / File Is Successfully Deleted β
")
|
234 |
+
await k.edit_text("Your Video / File Is Successfully Deleted β
")
|
235 |
|
236 |
|
237 |
|