From 08af907807a109bc55cfa750fc93498d9cbbe1c0 Mon Sep 17 00:00:00 2001 From: Anurag <30367300+anurag-7@users.noreply.github.com> Date: Sat, 27 Jun 2020 08:22:36 +0530 Subject: [PATCH] Change PartialInviteGuild.icon_url_as to mimic Guild.icon_url_as --- discord/invite.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/discord/invite.py b/discord/invite.py index cfbbdf72e..e16fbe78d 100644 --- a/discord/invite.py +++ b/discord/invite.py @@ -154,10 +154,17 @@ class PartialInviteGuild: def icon_url(self): """:class:`Asset`: Returns the guild's icon asset.""" return self.icon_url_as() + + def is_icon_animated(self): + """:class:`bool`: Returns True if the guild has an animated icon. - def icon_url_as(self, *, format='webp', size=1024): + .. versionadded:: 1.4 + """ + return bool(self.icon and self.icon.startswith('a_')) + + def icon_url_as(self, *, format=None, static_format='webp', size=1024): """The same operation as :meth:`Guild.icon_url_as`.""" - return Asset._from_guild_image(self._state, self.id, self.icon, 'icons', format=format, size=size) + return Asset._from_guild_icon(self._state, self, format=format, static_format=static_format, size=size) @property def banner_url(self):