shayypy / guilded.py

Asynchronous Guilded API wrapper for Python
https://guildedpy.rtfd.io
Other
133 stars 25 forks source link

Add support for animated avatars #35

Closed no7here closed 2 years ago

no7here commented 2 years ago

Change format returned for user avatars from PNG to WEBP to support animated avatars.

shayypy commented 2 years ago

This will break for old avatars (webp, png). Guilded's CDN is designed for the client to not care about image extensions, but we can crowbar in support with something like _from_user_avatar(..., maybe_animated=True) or by returning the source image extension with strip_cdn_url assuming Guilded will always return full CDN URLs in their API. This change also needs a docstring warning in with_format/with_static_format.

no7here commented 2 years ago

Oh right, I didn't realise old avatars worked differently and wasn't able to test them.