@@ -84,6 +84,17 @@ class GuildMember extends Base {
8484 } else if ( typeof this . avatar !== 'string' ) {
8585 this . avatar = null ;
8686 }
87+
88+ if ( 'banner' in data ) {
89+ /**
90+ * The guild member's banner hash.
91+ * @type {?string }
92+ */
93+ this . banner = data . banner ;
94+ } else {
95+ this . banner ??= null ;
96+ }
97+
8798 if ( 'joined_at' in data ) this . joinedTimestamp = Date . parse ( data . joined_at ) ;
8899 if ( 'premium_since' in data ) {
89100 this . premiumSinceTimestamp = data . premium_since ? Date . parse ( data . premium_since ) : null ;
@@ -155,6 +166,15 @@ class GuildMember extends Base {
155166 return this . avatar && this . client . rest . cdn . guildMemberAvatar ( this . guild . id , this . id , this . avatar , options ) ;
156167 }
157168
169+ /**
170+ * A link to the member's banner.
171+ * @param {ImageURLOptions } [options={}] Options for the banner URL
172+ * @returns {?string }
173+ */
174+ bannerURL ( options = { } ) {
175+ return this . banner && this . client . rest . cdn . guildMemberBanner ( this . guild . id , this . id , this . banner , options ) ;
176+ }
177+
158178 /**
159179 * A link to the member's guild avatar if they have one.
160180 * Otherwise, a link to their {@link User#displayAvatarURL} will be returned.
@@ -165,6 +185,16 @@ class GuildMember extends Base {
165185 return this . avatarURL ( options ) ?? this . user . displayAvatarURL ( options ) ;
166186 }
167187
188+ /**
189+ * A link to the member's guild banner if they have one.
190+ * Otherwise, a link to their {@link User#bannerURL} will be returned.
191+ * @param {ImageURLOptions } [options={}] Options for the image URL
192+ * @returns {?string }
193+ */
194+ displayBannerURL ( options ) {
195+ return this . bannerURL ( options ) ?? this . user . bannerURL ( options ) ;
196+ }
197+
168198 /**
169199 * The time this member joined the guild
170200 * @type {?Date }
@@ -464,6 +494,7 @@ class GuildMember extends Base {
464494 this . joinedTimestamp === member . joinedTimestamp &&
465495 this . nickname === member . nickname &&
466496 this . avatar === member . avatar &&
497+ this . banner === member . banner &&
467498 this . pending === member . pending &&
468499 this . communicationDisabledUntilTimestamp === member . communicationDisabledUntilTimestamp &&
469500 this . flags . bitfield === member . flags . bitfield &&
@@ -491,7 +522,9 @@ class GuildMember extends Base {
491522 roles : true ,
492523 } ) ;
493524 json . avatarURL = this . avatarURL ( ) ;
525+ json . bannerURL = this . bannerURL ( ) ;
494526 json . displayAvatarURL = this . displayAvatarURL ( ) ;
527+ json . displayBannerURL = this . displayBannerURL ( ) ;
495528 return json ;
496529 }
497530}
0 commit comments