Jishu Developer commited on
Commit
f7f926a
Β·
unverified Β·
1 Parent(s): cc5984f

Update start.py

Browse files
Files changed (1) hide show
  1. 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
- # asyncio.create_task(delete_files(madflix_msgs, client))
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
- # async def delete_files(messages, client):
237
- # await asyncio.sleep(FILE_AUTO_DELETE) # Wait for the duration specified in config.py
238
- # for msg in messages:
239
- # try:
240
- # await client.delete_messages(chat_id=msg.chat.id, message_ids=[msg.id])
241
- # except Exception as e:
242
- # print(f"The attempt to delete the media {msg.id} was unsuccessful: {e}")
243
  # await client.send_message(messages[0].chat.id, "Your Video / File Is Successfully Deleted βœ…")
244
- # await k.edit_text("Your Video / File Is Successfully Deleted βœ…")
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