AS
Если нет, есть ли альтернативы?
Size: a a a
AS
А
NK
NK
NK
async def set_profilepic(propic):
if not propic.text[0].isalpha() and propic.text[0] not in ("/", "#", "@", "!"):
replymsg = await propic.get_reply_message()
photo = None
if replymsg.media:
if isinstance(replymsg.media, MessageMediaPhoto):
photo = await client.download_media(message=replymsg.photo)
elif "image" in replymsg.media.document.mime_type.split('/'):
photo = await client.download_file(replymsg.media.document)
else:
await propic.edit(INVALID_MEDIA)
if photo:
try:
await client(UploadProfilePhotoRequest(
await client.upload_file(photo)
))
os.remove(photo)
await propic.edit(PP_CHANGED)
except PhotoCropSizeSmallError:
await propic.edit(PP_TOO_SMOL)
except ImageProcessFailedError:
await propic.edit(PP_ERROR)
except PhotoExtInvalidError:
await propic.edit(INVALID_MEDIA)
NK
r
NK
NK
NK
r
K0
NK
NK
NK
NK
K0
K0
NK
K0