Update pyUltroid/startup/funcs.py
Browse files
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 |
)
|