mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-23 02:38:29 +02:00
Don't re-upload a new avatar every time
This commit is contained in:
@ -68,6 +68,16 @@ class Matrix:
|
||||
client = await cls._get_client()
|
||||
return await client.set_avatar(avatar_url)
|
||||
|
||||
@classmethod
|
||||
@async_to_sync
|
||||
async def get_avatar(cls): # pragma: no cover
|
||||
"""
|
||||
Set the display avatar of the bot account.
|
||||
"""
|
||||
client = await cls._get_client()
|
||||
resp = await client.get_avatar()
|
||||
return resp.avatar_url if resp.status_code == 200 else resp
|
||||
|
||||
@classmethod
|
||||
@async_to_sync
|
||||
async def upload(
|
||||
|
Reference in New Issue
Block a user