Improved avatars preview a bit
This commit is contained in:
parent
efcb60ed95
commit
c8f1ef5741
@ -53,6 +53,8 @@ async def inline_answer(client, inline_query):
|
||||
|
||||
if match.user.photo != None:
|
||||
try:
|
||||
if not path.exists(f'{configGet("cache", "locations")}{sep}avatars{sep}{match.user.photo.big_file_id}'):
|
||||
print(f'Downloaded avatar {match.user.photo.big_file_id} of {match.user.id} and uploaded to {configGet("api")}/?avatar_id={match.user.photo.big_file_id}', flush=True)
|
||||
await app.download_media(match.user.photo.big_file_id, file_name=f'{configGet("cache", "locations")}{sep}avatars{sep}{match.user.photo.big_file_id}')
|
||||
results.append(
|
||||
InlineQueryResultArticle(
|
||||
@ -64,7 +66,6 @@ async def inline_answer(client, inline_query):
|
||||
thumb_url=f'{configGet("api")}/?avatar_id={match.user.photo.big_file_id}'
|
||||
)
|
||||
)
|
||||
print(f'{configGet("api")}/?avatar_id={match.user.photo.big_file_id}', flush=True)
|
||||
except ValueError:
|
||||
results.append(
|
||||
InlineQueryResultArticle(
|
||||
|
Reference in New Issue
Block a user