xdragxt commited on
Commit
0e85329
·
verified ·
1 Parent(s): ce187b4

Update pyUltroid/startup/funcs.py

Browse files
Files changed (1) hide show
  1. pyUltroid/startup/funcs.py +4 -0
pyUltroid/startup/funcs.py CHANGED
@@ -358,6 +358,10 @@ async def customize():
358
  if not os.path.exists(file):
359
  file, _ = await download_file(file, "profile.jpg")
360
  rem = True
 
 
 
 
361
  msg = await asst.send_message(
362
  chat_id, "**Auto Customisation** Started on @Botfather"
363
  )
 
358
  if not os.path.exists(file):
359
  file, _ = await download_file(file, "profile.jpg")
360
  rem = True
361
+ # Check if the file exists and is a valid file before sending
362
+ if not (os.path.exists(file) and os.path.isfile(file)):
363
+ LOGS.warning(f"Profile photo file '{file}' does not exist or is not a valid file. Skipping customization.")
364
+ return
365
  msg = await asst.send_message(
366
  chat_id, "**Auto Customisation** Started on @Botfather"
367
  )