fix(User): User.clan only being shown on self-user

This commit is contained in:
ZyGout
2025-06-27 01:11:48 -04:00
parent 4cd6390758
commit 2470ae17ec

View File

@@ -155,10 +155,9 @@ class User extends Base {
this.avatarDecorationData = null; this.avatarDecorationData = null;
} }
if ('clan' in data && data.clan) { if ('primary_guild' in data && data.primary_guild) {
/** /**
* User Clan Structure * User Clan Structure
* @see {@link https://docs.discord.sex/resources/user#user-clan-structure}
* @typedef {Object} UserClan * @typedef {Object} UserClan
* @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 clan tag
@@ -170,10 +169,10 @@ class User extends Base {
* @type {?UserClan} * @type {?UserClan}
*/ */
this.clan = { this.clan = {
identityGuildId: data.clan.identity_guild_id, identityGuildId: data.primary_guild.identity_guild_id,
identityEnabled: data.clan.identity_enabled, identityEnabled: data.primary_guild.identity_enabled,
tag: data.clan.tag, tag: data.primary_guild.tag,
badge: data.clan.badge, badge: data.primary_guild.badge,
}; };
} else { } else {
this.clan ??= null; this.clan ??= null;