chore: release v2.8.8
- User.themeColors - Update ClientBuild
This commit is contained in:
@@ -233,10 +233,6 @@ class User extends Base {
|
||||
this.premiumGuildSince = date.getTime();
|
||||
}
|
||||
|
||||
if ('bio' in data.user_profile || 'bio' in data.user) {
|
||||
this.bio = data.user_profile.bio || data.user.bio;
|
||||
}
|
||||
|
||||
if ('premium_type' in data) {
|
||||
const nitro = NitroType[data.premium_type ?? 0];
|
||||
/**
|
||||
@@ -246,6 +242,16 @@ class User extends Base {
|
||||
this.nitroType = nitro ?? `UNKNOWN_TYPE_${data.premium_type}`;
|
||||
}
|
||||
|
||||
if ('user_profile' in data) {
|
||||
this.bio = data.user_profile.bio;
|
||||
/**
|
||||
* The user's theme colors (Profile theme) [Primary, Accent]
|
||||
* <info>The user must be force fetched for this property to be present or be updated</info>
|
||||
* @type {?Array<number>}
|
||||
*/
|
||||
this.themeColors = data.user_profile.theme_colors;
|
||||
}
|
||||
|
||||
if ('guild_member_profile' in data && 'guild_member' in data) {
|
||||
const guild = this.client.guilds.cache.get(data.guild_member_profile.guild_id);
|
||||
const member = guild?.members._add(data.guild_member);
|
||||
@@ -442,6 +448,16 @@ class User extends Base {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The hexadecimal version of the user theme color, with a leading hash [Primary, Accent]
|
||||
* <info>The user must be force fetched for this property to be present or be updated</info>
|
||||
* @type {?Array<string>}
|
||||
* @readonly
|
||||
*/
|
||||
get hexThemeColor() {
|
||||
return this.themeColors?.map(c => `#${c.toString(16).padStart(6, '0')}`) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Discord "tag" (e.g. `hydrabolt#0001`) for this user
|
||||
* @type {?string}
|
||||
|
||||
Reference in New Issue
Block a user