This commit is contained in:
Elysia 2023-06-21 11:57:21 +07:00
parent a176df7e20
commit aa749efa64
3 changed files with 24 additions and 14 deletions

View File

@ -617,7 +617,7 @@ class ClientUser extends User {
/** /**
* Set pronouns * Set pronouns
* @param {string | null} pronouns * @param {?string} pronouns Your pronouns
* @returns {Promise<ClientUser>} * @returns {Promise<ClientUser>}
*/ */
setPronouns(pronouns = '') { setPronouns(pronouns = '') {

View File

@ -54,33 +54,29 @@ class User extends Base {
* Time that User has nitro (Unix Timestamp) * Time that User has nitro (Unix Timestamp)
* <info>The user must be force fetched for this property to be present or be updated</info> * <info>The user must be force fetched for this property to be present or be updated</info>
* @type {?number} * @type {?number}
* @readonly
*/ */
this.premiumSince = null; this.premiumSince = null;
/** /**
* Time that User has nitro and boost server (Unix Timestamp) * Time that User has nitro and boost server (Unix Timestamp)
* @type {?number} * @type {?number}
* @readonly
*/ */
this.premiumGuildSince = null; this.premiumGuildSince = null;
/** /**
* About me (User) * About me (User)
* <info>The user must be force fetched for this property to be present or be updated</info> * <info>The user must be force fetched for this property to be present or be updated</info>
* @type {?string} * @type {?string}
* @readonly
*/ */
this.bio = null; this.bio = null;
/** /**
* This user is on the same servers as Client User * Pronouns (User)
* <info>The user must be force fetched for this property to be present or be updated</info> * <info>The user must be force fetched for this property to be present or be updated</info>
* @type {Collection<Snowflake, Guild>} * @type {?string}
* @readonly
*/ */
this.mutualGuilds = new Collection(); this.pronouns = null;
this._mutualGuilds = [];
/** /**
* [Bot] Application * [Bot] Application
* @type {?ClientApplication} * @type {?ClientApplication}
* @readonly
*/ */
this.application = application ? new ClientApplication(this.client, application, this) : null; this.application = application ? new ClientApplication(this.client, application, this) : null;
this._partial = true; this._partial = true;
@ -202,6 +198,16 @@ class User extends Base {
} }
} }
/**
* This user is on the same servers as Client User
* <info>The user must be force fetched for this property to be present or be updated</info>
* @type {Collection<Snowflake, Guild>}
* @readonly
*/
get mutualGuilds() {
return new Collection(this._mutualGuilds.map(obj => [obj.id, obj]));
}
/** /**
* Get all mutual friends (Client -> User) * Get all mutual friends (Client -> User)
* @type {Promise<Collection<Snowflake, User>>} * @type {Promise<Collection<Snowflake, User>>}
@ -335,7 +341,9 @@ class User extends Base {
// Unknown // Unknown
} }
this.mutualGuilds = new Collection(data.mutual_guilds.map(obj => [obj.id, obj])); if ('mutual_guilds' in data) {
this._mutualGuilds = data.mutual_guilds;
}
} }
/** /**

10
typings/index.d.ts vendored
View File

@ -1090,6 +1090,7 @@ export class ClientUser extends User {
public readonly emailAddress: string; public readonly emailAddress: string;
public stopRinging(channel: ChannelResolvable): Promise<void>; public stopRinging(channel: ChannelResolvable): Promise<void>;
public setGlobalName(globalName?: string): Promise<this>; public setGlobalName(globalName?: string): Promise<this>;
public setPronouns(pronouns?: string): Promise<this>;
} }
type NitroType = 'NONE' | 'NITRO_CLASSIC' | 'NITRO_BOOST' | 'NITRO_BASIC'; type NitroType = 'NONE' | 'NITRO_CLASSIC' | 'NITRO_BOOST' | 'NITRO_BASIC';
@ -3256,6 +3257,7 @@ export class User extends PartialTextBasedChannel(Base) {
public avatarDecoration: string | null; public avatarDecoration: string | null;
public banner: string | null | undefined; public banner: string | null | undefined;
public bot: boolean; public bot: boolean;
public pronouns: string | null;
public readonly createdAt: Date; public readonly createdAt: Date;
public readonly relationships: RelationshipTypes; public readonly relationships: RelationshipTypes;
public readonly createdTimestamp: number; public readonly createdTimestamp: number;
@ -3275,10 +3277,10 @@ export class User extends PartialTextBasedChannel(Base) {
public username: string; public username: string;
public readonly note: string | null; public readonly note: string | null;
public readonly nickname: string | null; public readonly nickname: string | null;
public readonly connectedAccounts: object[]; public connectedAccounts: object[];
public readonly premiumSince: Date; public premiumSince: Date;
public readonly premiumGuildSince: Date; public premiumGuildSince: Date;
public readonly bio: string | null; public bio: string | null;
public readonly mutualGuilds: Collection<Snowflake, object>; public readonly mutualGuilds: Collection<Snowflake, object>;
public readonly mutualFriends: Promise<Collection<Snowflake, User>>; public readonly mutualFriends: Promise<Collection<Snowflake, User>>;
public readonly voice: VoiceState; public readonly voice: VoiceState;