diff --git a/discord/abc.py b/discord/abc.py index 6d13a8562..7ff70e762 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -347,6 +347,14 @@ class User(Snowflake, Protocol): """Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar, if present.""" raise NotImplementedError + @property + def avatar_decoration(self) -> Optional[Asset]: + """Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar decoration, if present. + + .. versionadded:: 2.0 + """ + raise NotImplementedError + @property def default_avatar(self) -> Asset: """:class:`~discord.Asset`: Returns the default avatar for a given user. This is calculated by the user's discriminator.""" diff --git a/discord/member.py b/discord/member.py index fae6baa3b..120554a42 100644 --- a/discord/member.py +++ b/discord/member.py @@ -289,6 +289,7 @@ class Member(discord.abc.Messageable, discord.abc.Connectable, _UserTag): created_at: datetime.datetime default_avatar: Asset avatar: Optional[Asset] + avatar_decoration: Optional[Asset] dm_channel: Optional[DMChannel] create_dm: Callable[[], Awaitable[DMChannel]] mutual_guilds: List[Guild] diff --git a/discord/user.py b/discord/user.py index 906b28ecf..85ca110ad 100644 --- a/discord/user.py +++ b/discord/user.py @@ -887,12 +887,18 @@ class User(BaseUser, discord.abc.Connectable, discord.abc.Messageable): if len(user) == 0 or len(user) <= 1: # Done because of typing return - original = (self.name, self._avatar, self.discriminator, self._public_flags) + original = (self.name, self._avatar, self.discriminator, self._public_flags, self._avatar_decoration) # These keys seem to always be available - modified = (user['username'], user.get('avatar'), user['discriminator'], user.get('public_flags', 0)) + modified = ( + user['username'], + user.get('avatar'), + user['discriminator'], + user.get('public_flags', 0), + user.get('avatar_decoration'), + ) if original != modified: to_return = User._copy(self) - self.name, self._avatar, self.discriminator, self._public_flags = modified + self.name, self._avatar, self.discriminator, self._public_flags, self._avatar_decoration = modified # Signal to dispatch user_update return to_return, self