Skip to content

Commit

Permalink
Undo changes and change lazy discriminator to 0000
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies authored May 26, 2021
1 parent 929153a commit 16fb9fc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions discord/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,7 @@ def avatar_url_as(self, *, format=None, static_format='webp', size=1024):
@property
def default_avatar(self):
""":class:`DefaultAvatar`: Returns the default avatar for a given user. This is calculated by the user's discriminator."""
try:
avatar = try_enum(DefaultAvatar, int(self.discriminator) % len(DefaultAvatar))
except ValueError:
# With lazy users, the discriminator is broken.
avatar = 0
return avatar
return avatar = try_enum(DefaultAvatar, int(self.discriminator) % len(DefaultAvatar))

@property
def default_avatar_url(self):
Expand Down Expand Up @@ -853,7 +848,7 @@ def __init__(self, state, user_id):
fake_data = {
'username': None,
'id': user_id,
'discriminator': 'BUMBA',
'discriminator': 0000,
'avatar': None,
}

Expand Down

0 comments on commit 16fb9fc

Please sign in to comment.