Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/core/src/api/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
type RESTPostAPIChannelWebhookJSONBody,
type RESTPostAPIChannelWebhookResult,
type RESTPostAPIGuildForumThreadsJSONBody,
type RESTPostAPISendSoundboardSoundResult,
type RESTPostAPISoundboardSendSoundJSONBody,
type RESTPutAPIChannelPermissionJSONBody,
type RESTPutAPIChannelRecipientJSONBody,
Expand Down Expand Up @@ -702,11 +701,11 @@ export class ChannelsAPI {
body: RESTPostAPISoundboardSendSoundJSONBody,
{ auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {},
) {
return this.rest.post(Routes.sendSoundboardSound(channelId), {
await this.rest.post(Routes.sendSoundboardSound(channelId), {
auth,
body,
signal,
}) as Promise<RESTPostAPISendSoundboardSoundResult>;
});
}

/**
Expand Down
18 changes: 17 additions & 1 deletion packages/discord.js/src/structures/GuildMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { DiscordjsError, ErrorCodes } = require('../errors/index.js');
const { GuildMemberRoleManager } = require('../managers/GuildMemberRoleManager.js');
const { GuildMemberFlagsBitField } = require('../util/GuildMemberFlagsBitField.js');
const { PermissionsBitField } = require('../util/PermissionsBitField.js');
const { _transformCollectibles } = require('../util/Transformers.js');
const { Base } = require('./Base.js');
const { VoiceState } = require('./VoiceState.js');

Expand Down Expand Up @@ -150,6 +151,17 @@ class GuildMember extends Base {
} else {
this.avatarDecorationData = null;
}

if ('collectibles' in data) {
/**
* The member's collectibles
*
* @type {?Collectibles}
*/
this.collectibles = data.collectibles ? _transformCollectibles(data.collectibles) : null;
} else {
this.collectibles ??= null;
}
}

_clone() {
Expand Down Expand Up @@ -599,7 +611,11 @@ class GuildMember extends Base {
(this._roles.length === member._roles.length &&
this._roles.every((role, index) => role === member._roles[index]))) &&
this.avatarDecorationData?.asset === member.avatarDecorationData?.asset &&
this.avatarDecorationData?.skuId === member.avatarDecorationData?.skuId
this.avatarDecorationData?.skuId === member.avatarDecorationData?.skuId &&
this.collectibles?.nameplate?.skuId === member.collectibles?.nameplate?.skuId &&
this.collectibles?.nameplate?.asset === member.collectibles?.nameplate?.asset &&
this.collectibles?.nameplate?.label === member.collectibles?.nameplate?.label &&
this.collectibles?.nameplate?.palette === member.collectibles?.nameplate?.palette
);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/discord.js/src/structures/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ class User extends Base {
* @property {?NameplateData} nameplate The user's nameplate data
*/

if (data.collectibles) {
if ('collectibles' in data) {
/**
* The user's collectibles
*
* @type {?Collectibles}
*/
this.collectibles = _transformCollectibles(data.collectibles);
this.collectibles = data.collectibles ? _transformCollectibles(data.collectibles) : null;
} else {
this.collectibles = null;
this.collectibles ??= null;
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,7 @@ export class GuildMember extends Base {
public avatarDecorationData: AvatarDecorationData | null;
public banner: string | null;
public get bannable(): boolean;
public collectibles: Collectibles | null;
public get dmChannel(): DMChannel | null;
public get displayColor(): number;
public get displayHexColor(): HexColorString;
Expand Down
Loading