pmrony commited on
Commit
276b7de
·
verified ·
1 Parent(s): febb018

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -420,7 +420,7 @@ async def send_to_specific_group(client, message):
420
 
421
  args = message.command
422
  if len(args) < 2:
423
- return await message.reply("❌ <b>Group ID missing!</b>\n\nCorrect format:\n`/sendto -1003973566529`")
424
 
425
  try:
426
  group_id = int(args[1])
@@ -827,7 +827,7 @@ async def handle_media_upload(client, message):
827
  process_blur = await asyncio.create_subprocess_exec(*cmd_blur, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
828
  await process_blur.communicate()
829
 
830
- # বাগ সংশোধন: ফাইলের সাইজ ০-এর চেয়ে বেশি হলে তবেই আউটপুট ব্যবহার করা হবে, অন্যথায় অরিজিনাল ফাইল ব্যবহৃত হবে
831
  if process_blur.returncode == 0 and os.path.exists(blurred_file) and os.path.getsize(blurred_file) > 0:
832
  telegram_file = blurred_file
833
 
@@ -907,7 +907,7 @@ async def handle_media_upload(client, message):
907
  except Exception as e: await message.reply(f"⚠️ Error occurred: {str(e)}")
908
  finally:
909
  for f in [original_file, watermarked_file, blurred_file, f"{original_file}_thumb.jpg" if original_file else None, f"{original_file}_storage_thumb.jpg" if original_file else None]:
910
- if f and os.path.exists(f):
911
  try: os.remove(f)
912
  except: pass
913
 
 
420
 
421
  args = message.command
422
  if len(args) < 2:
423
+ return await message.reply("❌ <b>Group ID missing!</b>\n\nCorrect format:\n`/sendto -1001234567890`")
424
 
425
  try:
426
  group_id = int(args[1])
 
827
  process_blur = await asyncio.create_subprocess_exec(*cmd_blur, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
828
  await process_blur.communicate()
829
 
830
+ # বাগ সংশোধন: ফাইলের সাইজ ০-এর চেয়ে বেশি হলে তবেই আউটপুট ব্যবহার করা হবে, অন্যথায় অরিジナাল ফাইল ব্যবহৃত হবে
831
  if process_blur.returncode == 0 and os.path.exists(blurred_file) and os.path.getsize(blurred_file) > 0:
832
  telegram_file = blurred_file
833
 
 
907
  except Exception as e: await message.reply(f"⚠️ Error occurred: {str(e)}")
908
  finally:
909
  for f in [original_file, watermarked_file, blurred_file, f"{original_file}_thumb.jpg" if original_file else None, f"{original_file}_storage_thumb.jpg" if original_file else None]:
910
+ if f && os.path.exists(f):
911
  try: os.remove(f)
912
  except: pass
913