@@ -122,6 +122,20 @@ class GuildMember extends Base {
122122 } else {
123123 this . flags ??= new GuildMemberFlagsBitField ( ) . freeze ( ) ;
124124 }
125+
126+ if ( data . avatar_decoration_data ) {
127+ /**
128+ * The member avatar decoration's data
129+ *
130+ * @type {?AvatarDecorationData }
131+ */
132+ this . avatarDecorationData = {
133+ asset : data . avatar_decoration_data . asset ,
134+ skuId : data . avatar_decoration_data . sku_id ,
135+ } ;
136+ } else {
137+ this . avatarDecorationData = null ;
138+ }
125139 }
126140
127141 _clone ( ) {
@@ -166,6 +180,15 @@ class GuildMember extends Base {
166180 return this . avatar && this . client . rest . cdn . guildMemberAvatar ( this . guild . id , this . id , this . avatar , options ) ;
167181 }
168182
183+ /**
184+ * A link to the member's avatar decoration.
185+ *
186+ * @returns {?string }
187+ */
188+ avatarDecorationURL ( ) {
189+ return this . avatarDecorationData ? this . client . rest . cdn . avatarDecoration ( this . avatarDecorationData . asset ) : null ;
190+ }
191+
169192 /**
170193 * A link to the member's banner.
171194 * @param {ImageURLOptions } [options={}] Options for the banner URL
@@ -195,6 +218,16 @@ class GuildMember extends Base {
195218 return this . bannerURL ( options ) ?? this . user . bannerURL ( options ) ;
196219 }
197220
221+ /**
222+ * A link to the member's guild avatar decoration if they have one.
223+ * Otherwise, a link to their {@link User#avatarDecorationURL} will be returned.
224+ *
225+ * @returns {?string }
226+ */
227+ displayAvatarDecorationURL ( ) {
228+ return this . avatarDecorationURL ( ) ?? this . user . avatarDecorationURL ( ) ;
229+ }
230+
198231 /**
199232 * The time this member joined the guild
200233 * @type {?Date }
@@ -499,7 +532,10 @@ class GuildMember extends Base {
499532 this . communicationDisabledUntilTimestamp === member . communicationDisabledUntilTimestamp &&
500533 this . flags . bitfield === member . flags . bitfield &&
501534 ( this . _roles === member . _roles ||
502- ( this . _roles . length === member . _roles . length && this . _roles . every ( ( role , i ) => role === member . _roles [ i ] ) ) )
535+ ( this . _roles . length === member . _roles . length &&
536+ this . _roles . every ( ( role , index ) => role === member . _roles [ index ] ) ) ) &&
537+ this . avatarDecorationData ?. asset === member . avatarDecorationData ?. asset &&
538+ this . avatarDecorationData ?. skuId === member . avatarDecorationData ?. skuId
503539 ) ;
504540 }
505541
@@ -525,6 +561,7 @@ class GuildMember extends Base {
525561 json . bannerURL = this . bannerURL ( ) ;
526562 json . displayAvatarURL = this . displayAvatarURL ( ) ;
527563 json . displayBannerURL = this . displayBannerURL ( ) ;
564+ json . avatarDecorationURL = this . avatarDecorationURL ( ) ;
528565 return json ;
529566 }
530567}
0 commit comments