txlyre 1 жил өмнө
parent
commit
c63fc44d00

+ 4 - 1
commands.py

@@ -243,7 +243,7 @@ async def make_message_shot(bot, message):
   avatar_path = await make_cache_filename(sender_id, 'png')
 
   if not await path.isfile(avatar_path):
-    await bot.download_profile_photo(sender_id, file=avatar_path)
+    await bot.download_profile_photo(sender_id, file=avatar_path, download_big=True)
 
     # TO-DO: make it better.
     mproc = await create_subprocess_shell(
@@ -251,6 +251,9 @@ async def make_message_shot(bot, message):
     )
     await mproc.communicate()
 
+  if not await path.isfile(avatar_path):
+    avatar_path = './resources/placeholder.png'
+
   data = bytes()
 
   data += pack('I', len(output_path))

BIN
resources/placeholder.png