Skip to content

Commit 929153a

Browse files
authored
Update avatar fix
1 parent 3b85533 commit 929153a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

discord/user.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ def avatar_url_as(self, *, format=None, static_format='webp', size=1024):
195195
def default_avatar(self):
196196
""":class:`DefaultAvatar`: Returns the default avatar for a given user. This is calculated by the user's discriminator."""
197197
try:
198-
return try_enum(DefaultAvatar, int(self.discriminator) % len(DefaultAvatar))
198+
avatar = try_enum(DefaultAvatar, int(self.discriminator) % len(DefaultAvatar))
199199
except ValueError:
200-
return 0
200+
# With lazy users, the discriminator is broken.
201+
avatar = 0
202+
return avatar
201203

202204
@property
203205
def default_avatar_url(self):

0 commit comments

Comments
 (0)