mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-28 03:52:57 +00:00
Improve performance of value -> enum by about 5x.
This commit is contained in:
@@ -164,7 +164,7 @@ class BaseUser(_BaseUser):
|
||||
@property
|
||||
def default_avatar(self):
|
||||
"""Returns the default avatar for a given user. This is calculated by the user's discriminator"""
|
||||
return DefaultAvatar(int(self.discriminator) % len(DefaultAvatar))
|
||||
return try_enum(DefaultAvatar, int(self.discriminator) % len(DefaultAvatar))
|
||||
|
||||
@property
|
||||
def default_avatar_url(self):
|
||||
|
||||
Reference in New Issue
Block a user