mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-06 11:57:17 +00:00
Add support for animated guild banners
https://github.com/discord/discord-api-docs/pull/3948
This commit is contained in:
parent
338c960c5f
commit
0b77b52da2
@ -208,11 +208,13 @@ class Asset(AssetMixin):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _from_guild_image(cls, state, guild_id: int, image: str, path: str) -> Asset:
|
def _from_guild_image(cls, state, guild_id: int, image: str, path: str) -> Asset:
|
||||||
|
animated = image.startswith('a_')
|
||||||
|
format = 'gif' if animated else 'png'
|
||||||
return cls(
|
return cls(
|
||||||
state,
|
state,
|
||||||
url=f'{cls.BASE}/{path}/{guild_id}/{image}.png?size=1024',
|
url=f'{cls.BASE}/{path}/{guild_id}/{image}.{format}?size=1024',
|
||||||
key=image,
|
key=image,
|
||||||
animated=False,
|
animated=animated,
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -197,6 +197,7 @@ class Guild(Hashable):
|
|||||||
|
|
||||||
They are currently as follows:
|
They are currently as follows:
|
||||||
|
|
||||||
|
- ``ANIMATED_BANNER``: Guild can upload an animated banner.
|
||||||
- ``ANIMATED_ICON``: Guild can upload an animated icon.
|
- ``ANIMATED_ICON``: Guild can upload an animated icon.
|
||||||
- ``BANNER``: Guild can upload and use a banner. (i.e. :attr:`.banner`)
|
- ``BANNER``: Guild can upload and use a banner. (i.e. :attr:`.banner`)
|
||||||
- ``COMMERCE``: Guild can sell things using store channels.
|
- ``COMMERCE``: Guild can sell things using store channels.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user