diff --git a/disco/types/user.py b/disco/types/user.py index 81f1046..d2ac738 100644 --- a/disco/types/user.py +++ b/disco/types/user.py @@ -22,13 +22,13 @@ class User(SlottedModel, with_equality('id'), with_hash('id')): presence = Field(None) - def get_avatar_url(self): + def get_avatar_url(self, fmt='webp', size=1024): if not self.avatar: return 'https://cdn.discordapp.com/embed/avatars/{}.png'.format(self.default_avatar.value) elif self.avatar.startswith('a_'): - return 'https://cdn.discordapp.com/avatars/{}/{}.gif'.format(self.id, self.avatar) + return 'https://cdn.discordapp.com/avatars/{}/{}.gif?size={}'.format(self.id, self.avatar, size) else: - return 'https://cdn.discordapp.com/avatars/{}/{}.png'.format(self.id, self.avatar) + return 'https://cdn.discordapp.com/avatars/{}/{}.{}?size={}'.format(self.id, self.avatar, fmt, size) @property def default_avatar(self):