|
@ -22,17 +22,11 @@ class User(SlottedModel, with_equality('id'), with_hash('id')): |
|
|
|
|
|
|
|
|
presence = Field(None) |
|
|
presence = Field(None) |
|
|
|
|
|
|
|
|
def get_avatar_url(self, fmt=None, force_fmt=True, size=1024): |
|
|
def get_avatar_url(self, fmt=None, size=1024): |
|
|
if not self.avatar: |
|
|
if not self.avatar: |
|
|
return 'https://cdn.discordapp.com/embed/avatars/{}.png'.format(self.default_avatar.value) |
|
|
return 'https://cdn.discordapp.com/embed/avatars/{}.png'.format(self.default_avatar.value) |
|
|
if fmt is not None: |
|
|
if fmt is not None: |
|
|
if force_fmt is False: |
|
|
return 'https://cdn.discordapp.com/avatars/{}/{}.{}?size={}'.format(self.id, self.avatar, fmt, size) |
|
|
if self.avatar.startswith('a_'): |
|
|
|
|
|
return 'https://cdn.discordapp.com/avatars/{}/{}.gif?size={}'.format(self.id, self.avatar, size) |
|
|
|
|
|
else: |
|
|
|
|
|
return 'https://cdn.discordapp.com/avatars/{}/{}.{}?size={}'.format(self.id, self.avatar, fmt, size) |
|
|
|
|
|
else: |
|
|
|
|
|
return 'https://cdn.discordapp.com/avatars/{}/{}.{}?size={}'.format(self.id, self.avatar, fmt, size) |
|
|
|
|
|
if self.avatar.startswith('a_'): |
|
|
if self.avatar.startswith('a_'): |
|
|
return 'https://cdn.discordapp.com/avatars/{}/{}.gif?size={}'.format(self.id, self.avatar, size) |
|
|
return 'https://cdn.discordapp.com/avatars/{}/{}.gif?size={}'.format(self.id, self.avatar, size) |
|
|
else: |
|
|
else: |
|
|