@@ -70,6 +70,7 @@ class BaseUser(_UserTag):
70
70
"bot" ,
71
71
"system" ,
72
72
"_public_flags" ,
73
+ "_avatar_decoration" ,
73
74
"_state" ,
74
75
)
75
76
@@ -84,6 +85,7 @@ class BaseUser(_UserTag):
84
85
_avatar : str | None
85
86
_banner : str | None
86
87
_accent_colour : int | None
88
+ _avatar_decoration : dict | None
87
89
_public_flags : int
88
90
89
91
def __init__ (self , * , state : ConnectionState , data : UserPayload ) -> None :
@@ -134,6 +136,7 @@ def _update(self, data: UserPayload) -> None:
134
136
self ._avatar = data ["avatar" ]
135
137
self ._banner = data .get ("banner" , None )
136
138
self ._accent_colour = data .get ("accent_color" , None )
139
+ self ._avatar_decoration = data .get ("avatar_decoration_data" , None )
137
140
self ._public_flags = data .get ("public_flags" , 0 )
138
141
self .bot = data .get ("bot" , False )
139
142
self .system = data .get ("system" , False )
@@ -149,6 +152,7 @@ def _copy(cls: type[BU], user: BU) -> BU:
149
152
self ._avatar = user ._avatar
150
153
self ._banner = user ._banner
151
154
self ._accent_colour = user ._accent_colour
155
+ self ._avatar_decoration = user ._avatar_decoration
152
156
self .bot = user .bot
153
157
self ._state = user ._state
154
158
self ._public_flags = user ._public_flags
@@ -221,6 +225,18 @@ def banner(self) -> Asset | None:
221
225
return None
222
226
return Asset ._from_user_banner (self ._state , self .id , self ._banner )
223
227
228
+ @property
229
+ def avatar_decoration (self ) -> Asset | None :
230
+ """Returns the user's avatar decoration, if available.
231
+
232
+ .. versionadded:: 2.5
233
+ """
234
+ if self ._avatar_decoration is None :
235
+ return None
236
+ return Asset ._from_avatar_decoration (
237
+ self ._state , self .id , self ._avatar_decoration .get ("asset" )
238
+ )
239
+
224
240
@property
225
241
def accent_colour (self ) -> Colour | None :
226
242
"""Returns the user's accent colour, if applicable.
0 commit comments