From 87172ff5b42d9b60cc0fc93a8e249cf307aa82d9 Mon Sep 17 00:00:00 2001 From: Dooley_labs Date: Sat, 6 Oct 2018 18:54:12 -0400 Subject: [PATCH] Update user.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should keep everyone happy... hopefully 🤔 --- disco/types/user.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/disco/types/user.py b/disco/types/user.py index d2ac738..45bdc19 100644 --- a/disco/types/user.py +++ b/disco/types/user.py @@ -22,12 +22,14 @@ class User(SlottedModel, with_equality('id'), with_hash('id')): presence = Field(None) - def get_avatar_url(self, fmt='webp', size=1024): + def get_avatar_url(self, fmt=None, size=1024): if not self.avatar: return 'https://cdn.discordapp.com/embed/avatars/{}.png'.format(self.default_avatar.value) - elif self.avatar.startswith('a_'): + elif self.avatar.startswith('a_') and fmt is None: return 'https://cdn.discordapp.com/avatars/{}/{}.gif?size={}'.format(self.id, self.avatar, size) else: + if fmt is None: + fmt='webp' return 'https://cdn.discordapp.com/avatars/{}/{}.{}?size={}'.format(self.id, self.avatar, fmt, size) @property