@@ -202,7 +202,7 @@ class GuildScheduledEvent extends Base {
|
||||
* @returns {?string}
|
||||
*/
|
||||
coverImageURL({ format, size } = {}) {
|
||||
return this.image && this.client.rest.cdn.guildScheduledEventCover(this.id, this.image, format, size);
|
||||
return this.image && this.client.rest.cdn.GuildScheduledEventCover(this.id, this.image, format, size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -136,17 +136,6 @@ class User extends Base {
|
||||
this.flags = new UserFlags(data.public_flags);
|
||||
}
|
||||
|
||||
if ('avatar_decoration' in data) {
|
||||
/**
|
||||
* The user avatar decoration's hash
|
||||
* @type {?string}
|
||||
* @deprecated Use `avatarDecorationData` instead
|
||||
*/
|
||||
this.avatarDecoration = data.avatar_decoration;
|
||||
} else {
|
||||
this.avatarDecoration ??= null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} AvatarDecorationData
|
||||
* @property {string} asset The avatar decoration hash
|
||||
@@ -191,6 +180,16 @@ class User extends Base {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The user avatar decoration's hash
|
||||
* @type {?string}
|
||||
* @deprecated Use `avatarDecorationData` instead
|
||||
* Removed in v4
|
||||
*/
|
||||
get avatarDecoration() {
|
||||
return this.avatarDecorationData?.asset || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this User is a partial
|
||||
* @type {boolean}
|
||||
@@ -231,13 +230,12 @@ class User extends Base {
|
||||
/**
|
||||
* A link to the user's avatar decoration.
|
||||
* @param {StaticImageURLOptions} [options={}] Options for the image URL
|
||||
* <info> The `format` option is not supported for this image URL</info>
|
||||
* @returns {?string}
|
||||
*/
|
||||
avatarDecorationURL({ format, size } = {}) {
|
||||
if (this.avatarDecorationData) {
|
||||
return this.client.rest.cdn.AvatarDecoration(this.id, this.avatarDecorationData.asset, format, size);
|
||||
}
|
||||
return this.avatarDecoration && this.client.rest.cdn.AvatarDecoration(this.id, this.avatarDecoration, format, size);
|
||||
avatarDecorationURL({ size } = {}) {
|
||||
if (!this.avatarDecorationData) return null;
|
||||
return this.client.rest.cdn.AvatarDecoration(this.avatarDecorationData.asset, size);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,7 +359,6 @@ class User extends Base {
|
||||
this.flags?.bitfield === user.flags?.bitfield &&
|
||||
this.banner === user.banner &&
|
||||
this.accentColor === user.accentColor &&
|
||||
this.avatarDecoration === user.avatarDecoration &&
|
||||
this.avatarDecorationData?.asset === user.avatarDecorationData?.asset &&
|
||||
this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId
|
||||
);
|
||||
@@ -384,7 +381,6 @@ class User extends Base {
|
||||
this.flags?.bitfield === user.public_flags &&
|
||||
('banner' in user ? this.banner === user.banner : true) &&
|
||||
('accent_color' in user ? this.accentColor === user.accent_color : true) &&
|
||||
('avatar_decoration' in user ? this.avatarDecoration === user.avatar_decoration : true) &&
|
||||
('avatar_decoration_data' in user
|
||||
? this.avatarDecorationData?.asset === user.avatar_decoration_data?.asset &&
|
||||
this.avatarDecorationData?.skuId === user.avatar_decoration_data?.sku_id
|
||||
|
||||
@@ -96,13 +96,17 @@ exports.Endpoints = {
|
||||
if (dynamic && hash.startsWith('a_')) format = 'gif';
|
||||
return makeImageUrl(`${root}/avatars/${userId}/${hash}`, { format, size });
|
||||
},
|
||||
AvatarDecoration: (userId, hash, format = 'png', size) =>
|
||||
makeImageUrl(`${root}/avatar-decorations/${userId}/${hash}`, { format, size }),
|
||||
AvatarDecoration: (hash, size) =>
|
||||
makeImageUrl(`${root}/avatar-decoration-presets/${hash}`, { format: 'png', size }),
|
||||
ClanBadge: (guildId, hash) => `${root}/clan-badges/${guildId}/${hash}.png`,
|
||||
GuildMemberAvatar: (guildId, memberId, hash, format = 'webp', size, dynamic = false) => {
|
||||
if (dynamic && hash.startsWith('a_')) format = 'gif';
|
||||
return makeImageUrl(`${root}/guilds/${guildId}/users/${memberId}/avatars/${hash}`, { format, size });
|
||||
},
|
||||
GuildMemberBanner: (guildId, memberId, hash, format = 'webp', size, dynamic = false) => {
|
||||
if (dynamic && hash.startsWith('a_')) format = 'gif';
|
||||
return makeImageUrl(`${root}/guilds/${guildId}/users/${memberId}/banners/${hash}`, { format, size });
|
||||
},
|
||||
Banner: (id, hash, format, size, dynamic = false) => {
|
||||
if (dynamic && hash.startsWith('a_')) format = 'gif';
|
||||
return makeImageUrl(`${root}/banners/${id}/${hash}`, { format, size });
|
||||
@@ -127,7 +131,7 @@ exports.Endpoints = {
|
||||
}`,
|
||||
RoleIcon: (roleId, hash, format = 'webp', size) =>
|
||||
makeImageUrl(`${root}/role-icons/${roleId}/${hash}`, { size, format }),
|
||||
guildScheduledEventCover: (scheduledEventId, coverHash, format, size) =>
|
||||
GuildScheduledEventCover: (scheduledEventId, coverHash, format, size) =>
|
||||
makeImageUrl(`${root}/guild-events/${scheduledEventId}/${coverHash}`, { size, format }),
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user