refactor: rename UserClan to PrimaryGuild and update related properties
This commit is contained in:
@@ -157,28 +157,38 @@ class User extends Base {
|
|||||||
|
|
||||||
if ('primary_guild' in data && data.primary_guild) {
|
if ('primary_guild' in data && data.primary_guild) {
|
||||||
/**
|
/**
|
||||||
* User Clan Structure
|
* Primary Guild Structure
|
||||||
* @typedef {Object} UserClan
|
* @see {@link https://docs.discord.food/resources/user#primary-guild-structure}
|
||||||
|
* @typedef {Object} PrimaryGuild
|
||||||
* @property {?Snowflake} identityGuildId The ID of the user's primary clan
|
* @property {?Snowflake} identityGuildId The ID of the user's primary clan
|
||||||
* @property {boolean} identityEnabled Whether the user is displaying their clan tag
|
* @property {?boolean} identityEnabled Whether the user is displaying their guild tag
|
||||||
* @property {?string} tag The text of the user's clan tag (max 4 characters)
|
* @property {?string} tag The user's guild tag (max 4 characters)
|
||||||
* @property {?string} badge The clan's badge hash
|
* @property {?string} badge The guild tag badge hash
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* The primary clan the user is in
|
* The primary clan the user is in
|
||||||
* @type {?UserClan}
|
* @type {?PrimaryGuild}
|
||||||
*/
|
*/
|
||||||
this.clan = {
|
this.primaryGuild = {
|
||||||
identityGuildId: data.primary_guild.identity_guild_id,
|
identityGuildId: data.primary_guild.identity_guild_id,
|
||||||
identityEnabled: data.primary_guild.identity_enabled,
|
identityEnabled: data.primary_guild.identity_enabled,
|
||||||
tag: data.primary_guild.tag,
|
tag: data.primary_guild.tag,
|
||||||
badge: data.primary_guild.badge,
|
badge: data.primary_guild.badge,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
this.clan ??= null;
|
this.primaryGuild ??= null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The primary clan the user is in
|
||||||
|
* @type {?PrimaryGuild}
|
||||||
|
* @deprecated Use `primaryGuild` instead
|
||||||
|
*/
|
||||||
|
get clan() {
|
||||||
|
return this.primaryGuild;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The user avatar decoration's hash
|
* The user avatar decoration's hash
|
||||||
* @type {?string}
|
* @type {?string}
|
||||||
|
|||||||
6
typings/index.d.ts
vendored
6
typings/index.d.ts
vendored
@@ -3612,7 +3612,7 @@ export class Typing extends Base {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UserClan {
|
export interface PrimaryGuild {
|
||||||
identityGuildId?: Snowflake;
|
identityGuildId?: Snowflake;
|
||||||
identityEnabled?: boolean;
|
identityEnabled?: boolean;
|
||||||
tag?: string;
|
tag?: string;
|
||||||
@@ -3654,7 +3654,9 @@ export class User extends PartialTextBasedChannel(Base) {
|
|||||||
public readonly voice?: VoiceState;
|
public readonly voice?: VoiceState;
|
||||||
public readonly relationship: RelationshipTypes;
|
public readonly relationship: RelationshipTypes;
|
||||||
public readonly friendNickname: string | null | undefined;
|
public readonly friendNickname: string | null | undefined;
|
||||||
public clan: UserClan | null;
|
public primaryGuild: PrimaryGuild | null;
|
||||||
|
/** @deprecated Use {@link User.primaryGuild} instead */
|
||||||
|
public clan: PrimaryGuild | null;
|
||||||
public avatarURL(options?: ImageURLOptions): string | null;
|
public avatarURL(options?: ImageURLOptions): string | null;
|
||||||
public avatarDecorationURL(options?: Omit<StaticImageURLOptions, 'format'>): string | null;
|
public avatarDecorationURL(options?: Omit<StaticImageURLOptions, 'format'>): string | null;
|
||||||
public bannerURL(options?: ImageURLOptions): string | null;
|
public bannerURL(options?: ImageURLOptions): string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user