Jishu Developer commited on
Commit
4c09ca1
Β·
unverified Β·
1 Parent(s): 11bbd75

Update start.py

Browse files
Files changed (1) hide show
  1. plugins/start.py +18 -10
plugins/start.py CHANGED
@@ -90,8 +90,16 @@ 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 madflix_msg in madflix_msgs:
97
  # try:
@@ -224,15 +232,15 @@ async def send_text(client: Bot, message: Message):
224
 
225
 
226
  # Function to handle file deletion
227
- async def delete_files(messages, client):
228
- await asyncio.sleep(FILE_AUTO_DELETE) # Wait for the duration specified in config.py
229
- for msg in messages:
230
- try:
231
- await client.delete_messages(chat_id=msg.chat.id, message_ids=[msg.id])
232
- except Exception as e:
233
- print(f"The attempt to delete the media {msg.id} was unsuccessful: {e}")
234
  # await client.send_message(messages[0].chat.id, "Your Video / File Is Successfully Deleted βœ…")
235
- await k.edit_text("Your Video / File Is Successfully Deleted βœ…")
236
 
237
 
238
 
 
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
+ await client.delete_messages(chat_id=msg.chat.id, message_ids=[msg.id])
99
+ except Exception as e:
100
+ print(f"The attempt to delete the media {msg.id} was unsuccessful: {e}")
101
+
102
+ await k.edit_text("Your Video / File Is Successfully Deleted βœ…")
103
 
104
  # for madflix_msg in madflix_msgs:
105
  # try:
 
232
 
233
 
234
  # Function to handle file deletion
235
+ # async def delete_files(messages, client):
236
+ # await asyncio.sleep(FILE_AUTO_DELETE) # Wait for the duration specified in config.py
237
+ # for msg in messages:
238
+ # try:
239
+ # await client.delete_messages(chat_id=msg.chat.id, message_ids=[msg.id])
240
+ # except Exception as e:
241
+ # print(f"The attempt to delete the media {msg.id} was unsuccessful: {e}")
242
  # await client.send_message(messages[0].chat.id, "Your Video / File Is Successfully Deleted βœ…")
243
+ # await k.edit_text("Your Video / File Is Successfully Deleted βœ…")
244
 
245
 
246