discord.js 15.0.0-dev.1752624900-d03cacbde → 15.0.0-dev.1752711321-1dfc511e4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/structures/User.js +67 -12
- package/typings/index.d.mts +13 -7
- package/typings/index.d.ts +13 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "discord.js",
|
|
4
|
-
"version": "15.0.0-dev.
|
|
4
|
+
"version": "15.0.0-dev.1752711321-1dfc511e4",
|
|
5
5
|
"description": "A powerful library for interacting with the Discord API",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./typings/index.d.ts",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"tslib": "^2.8.1",
|
|
63
63
|
"undici": "7.11.0",
|
|
64
64
|
"@discordjs/builders": "^1.11.1",
|
|
65
|
-
"@discordjs/formatters": "^0.6.1",
|
|
66
65
|
"@discordjs/collection": "^2.1.1",
|
|
66
|
+
"@discordjs/formatters": "^0.6.1",
|
|
67
67
|
"@discordjs/rest": "^2.5.0",
|
|
68
|
-
"@discordjs/
|
|
69
|
-
"@discordjs/
|
|
68
|
+
"@discordjs/ws": "^2.0.2",
|
|
69
|
+
"@discordjs/util": "^1.1.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@favware/cliff-jumper": "^4.1.0",
|
package/src/structures/User.js
CHANGED
|
@@ -139,18 +139,22 @@ class User extends Base {
|
|
|
139
139
|
* @property {Snowflake} skuId The id of the avatar decoration's SKU
|
|
140
140
|
*/
|
|
141
141
|
|
|
142
|
-
if (data
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
142
|
+
if ('avatar_decoration_data' in data) {
|
|
143
|
+
if (data.avatar_decoration_data) {
|
|
144
|
+
/**
|
|
145
|
+
* The user avatar decoration's data
|
|
146
|
+
*
|
|
147
|
+
* @type {?AvatarDecorationData}
|
|
148
|
+
*/
|
|
149
|
+
this.avatarDecorationData = {
|
|
150
|
+
asset: data.avatar_decoration_data.asset,
|
|
151
|
+
skuId: data.avatar_decoration_data.sku_id,
|
|
152
|
+
};
|
|
153
|
+
} else {
|
|
154
|
+
this.avatarDecorationData = null;
|
|
155
|
+
}
|
|
152
156
|
} else {
|
|
153
|
-
this.avatarDecorationData
|
|
157
|
+
this.avatarDecorationData ??= null;
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
/**
|
|
@@ -176,6 +180,34 @@ class User extends Base {
|
|
|
176
180
|
} else {
|
|
177
181
|
this.collectibles = null;
|
|
178
182
|
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @typedef {Object} UserPrimaryGuild
|
|
186
|
+
* @property {?Snowflake} identityGuildId The id of the user's primary guild
|
|
187
|
+
* @property {?boolean} identityEnabled Whether the user is displaying the primary guild's tag
|
|
188
|
+
* @property {?string} tag The user's guild tag. Limited to 4 characters
|
|
189
|
+
* @property {?string} badge The guild tag badge hash
|
|
190
|
+
*/
|
|
191
|
+
|
|
192
|
+
if ('primary_guild' in data) {
|
|
193
|
+
if (data.primary_guild) {
|
|
194
|
+
/**
|
|
195
|
+
* The primary guild of the user
|
|
196
|
+
*
|
|
197
|
+
* @type {?UserPrimaryGuild}
|
|
198
|
+
*/
|
|
199
|
+
this.primaryGuild = {
|
|
200
|
+
identityGuildId: data.primary_guild.identity_guild_id,
|
|
201
|
+
identityEnabled: data.primary_guild.identity_enabled,
|
|
202
|
+
tag: data.primary_guild.tag,
|
|
203
|
+
badge: data.primary_guild.badge,
|
|
204
|
+
};
|
|
205
|
+
} else {
|
|
206
|
+
this.primaryGuild = null;
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
this.primaryGuild ??= null;
|
|
210
|
+
}
|
|
179
211
|
}
|
|
180
212
|
|
|
181
213
|
/**
|
|
@@ -271,6 +303,18 @@ class User extends Base {
|
|
|
271
303
|
return this.banner && this.client.rest.cdn.banner(this.id, this.banner, options);
|
|
272
304
|
}
|
|
273
305
|
|
|
306
|
+
/**
|
|
307
|
+
* A link to the user's guild tag badge.
|
|
308
|
+
*
|
|
309
|
+
* @param {ImageURLOptions} [options={}] Options for the image URL
|
|
310
|
+
* @returns {?string}
|
|
311
|
+
*/
|
|
312
|
+
guildTagBadgeURL(options = {}) {
|
|
313
|
+
return this.primaryGuild?.badge
|
|
314
|
+
? this.client.rest.cdn.guildTagBadge(this.primaryGuild.identityGuildId, this.primaryGuild.badge, options)
|
|
315
|
+
: null;
|
|
316
|
+
}
|
|
317
|
+
|
|
274
318
|
/**
|
|
275
319
|
* The tag of this user
|
|
276
320
|
* <info>This user's username, or their legacy tag (e.g. `hydrabolt#0001`)
|
|
@@ -367,7 +411,11 @@ class User extends Base {
|
|
|
367
411
|
this.collectibles?.nameplate?.skuId === user.collectibles?.nameplate?.skuId &&
|
|
368
412
|
this.collectibles?.nameplate?.asset === user.collectibles?.nameplate?.asset &&
|
|
369
413
|
this.collectibles?.nameplate?.label === user.collectibles?.nameplate?.label &&
|
|
370
|
-
this.collectibles?.nameplate?.palette === user.collectibles?.nameplate?.palette
|
|
414
|
+
this.collectibles?.nameplate?.palette === user.collectibles?.nameplate?.palette &&
|
|
415
|
+
this.primaryGuild?.identityGuildId === user.primaryGuild?.identityGuildId &&
|
|
416
|
+
this.primaryGuild?.identityEnabled === user.primaryGuild?.identityEnabled &&
|
|
417
|
+
this.primaryGuild?.tag === user.primaryGuild?.tag &&
|
|
418
|
+
this.primaryGuild?.badge === user.primaryGuild?.badge
|
|
371
419
|
);
|
|
372
420
|
}
|
|
373
421
|
|
|
@@ -398,6 +446,12 @@ class User extends Base {
|
|
|
398
446
|
this.collectibles?.nameplate?.asset === user.collectibles?.nameplate?.asset &&
|
|
399
447
|
this.collectibles?.nameplate?.label === user.collectibles?.nameplate?.label &&
|
|
400
448
|
this.collectibles?.nameplate?.palette === user.collectibles?.nameplate?.palette
|
|
449
|
+
: true) &&
|
|
450
|
+
('primary_guild' in user
|
|
451
|
+
? this.primaryGuild?.identityGuildId === user.primary_guild?.identity_guild_id &&
|
|
452
|
+
this.primaryGuild?.identityEnabled === user.primary_guild?.identity_enabled &&
|
|
453
|
+
this.primaryGuild?.tag === user.primary_guild?.tag &&
|
|
454
|
+
this.primaryGuild?.badge === user.primary_guild?.badge
|
|
401
455
|
: true)
|
|
402
456
|
);
|
|
403
457
|
}
|
|
@@ -437,6 +491,7 @@ class User extends Base {
|
|
|
437
491
|
json.avatarURL = this.avatarURL();
|
|
438
492
|
json.displayAvatarURL = this.displayAvatarURL();
|
|
439
493
|
json.bannerURL = this.banner ? this.bannerURL() : this.banner;
|
|
494
|
+
json.guildTagBadgeURL = this.guildTagBadgeURL();
|
|
440
495
|
return json;
|
|
441
496
|
}
|
|
442
497
|
}
|
package/typings/index.d.mts
CHANGED
|
@@ -31,10 +31,7 @@ import {
|
|
|
31
31
|
APIComponentInModalActionRow,
|
|
32
32
|
APIContainerComponent,
|
|
33
33
|
APIEmbed,
|
|
34
|
-
APIEmbedAuthor,
|
|
35
34
|
APIEmbedField,
|
|
36
|
-
APIEmbedFooter,
|
|
37
|
-
APIEmbedImage,
|
|
38
35
|
APIEmbedProvider,
|
|
39
36
|
APIEmoji,
|
|
40
37
|
APIEntitlement,
|
|
@@ -3510,6 +3507,17 @@ export interface AvatarDecorationData {
|
|
|
3510
3507
|
skuId: Snowflake;
|
|
3511
3508
|
}
|
|
3512
3509
|
|
|
3510
|
+
export interface Collectibles {
|
|
3511
|
+
nameplate: NameplateData | null;
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
export interface UserPrimaryGuild {
|
|
3515
|
+
badge: string | null;
|
|
3516
|
+
identityEnabled: boolean | null;
|
|
3517
|
+
identityGuildId: Snowflake | null;
|
|
3518
|
+
tag: string | null;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3513
3521
|
export interface NameplateData {
|
|
3514
3522
|
asset: string;
|
|
3515
3523
|
label: string;
|
|
@@ -3517,10 +3525,6 @@ export interface NameplateData {
|
|
|
3517
3525
|
skuId: Snowflake;
|
|
3518
3526
|
}
|
|
3519
3527
|
|
|
3520
|
-
export interface Collectibles {
|
|
3521
|
-
nameplate: NameplateData | null;
|
|
3522
|
-
}
|
|
3523
|
-
|
|
3524
3528
|
export interface UnfurledMediaItemData {
|
|
3525
3529
|
url: string;
|
|
3526
3530
|
}
|
|
@@ -3553,12 +3557,14 @@ export class User extends Base {
|
|
|
3553
3557
|
public get hexAccentColor(): HexColorString | null | undefined;
|
|
3554
3558
|
public id: Snowflake;
|
|
3555
3559
|
public get partial(): false;
|
|
3560
|
+
public primaryGuild: UserPrimaryGuild | null;
|
|
3556
3561
|
public system: boolean;
|
|
3557
3562
|
public get tag(): string;
|
|
3558
3563
|
public username: string;
|
|
3559
3564
|
public avatarURL(options?: ImageURLOptions): string | null;
|
|
3560
3565
|
public avatarDecorationURL(): string | null;
|
|
3561
3566
|
public bannerURL(options?: ImageURLOptions): string | null | undefined;
|
|
3567
|
+
public guildTagBadgeURL(options?: ImageURLOptions): string | null;
|
|
3562
3568
|
public createDM(force?: boolean): Promise<DMChannel>;
|
|
3563
3569
|
public deleteDM(): Promise<DMChannel>;
|
|
3564
3570
|
public displayAvatarURL(options?: ImageURLOptions): string;
|
package/typings/index.d.ts
CHANGED
|
@@ -31,10 +31,7 @@ import {
|
|
|
31
31
|
APIComponentInModalActionRow,
|
|
32
32
|
APIContainerComponent,
|
|
33
33
|
APIEmbed,
|
|
34
|
-
APIEmbedAuthor,
|
|
35
34
|
APIEmbedField,
|
|
36
|
-
APIEmbedFooter,
|
|
37
|
-
APIEmbedImage,
|
|
38
35
|
APIEmbedProvider,
|
|
39
36
|
APIEmoji,
|
|
40
37
|
APIEntitlement,
|
|
@@ -3510,6 +3507,17 @@ export interface AvatarDecorationData {
|
|
|
3510
3507
|
skuId: Snowflake;
|
|
3511
3508
|
}
|
|
3512
3509
|
|
|
3510
|
+
export interface Collectibles {
|
|
3511
|
+
nameplate: NameplateData | null;
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
export interface UserPrimaryGuild {
|
|
3515
|
+
badge: string | null;
|
|
3516
|
+
identityEnabled: boolean | null;
|
|
3517
|
+
identityGuildId: Snowflake | null;
|
|
3518
|
+
tag: string | null;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3513
3521
|
export interface NameplateData {
|
|
3514
3522
|
asset: string;
|
|
3515
3523
|
label: string;
|
|
@@ -3517,10 +3525,6 @@ export interface NameplateData {
|
|
|
3517
3525
|
skuId: Snowflake;
|
|
3518
3526
|
}
|
|
3519
3527
|
|
|
3520
|
-
export interface Collectibles {
|
|
3521
|
-
nameplate: NameplateData | null;
|
|
3522
|
-
}
|
|
3523
|
-
|
|
3524
3528
|
export interface UnfurledMediaItemData {
|
|
3525
3529
|
url: string;
|
|
3526
3530
|
}
|
|
@@ -3553,12 +3557,14 @@ export class User extends Base {
|
|
|
3553
3557
|
public get hexAccentColor(): HexColorString | null | undefined;
|
|
3554
3558
|
public id: Snowflake;
|
|
3555
3559
|
public get partial(): false;
|
|
3560
|
+
public primaryGuild: UserPrimaryGuild | null;
|
|
3556
3561
|
public system: boolean;
|
|
3557
3562
|
public get tag(): string;
|
|
3558
3563
|
public username: string;
|
|
3559
3564
|
public avatarURL(options?: ImageURLOptions): string | null;
|
|
3560
3565
|
public avatarDecorationURL(): string | null;
|
|
3561
3566
|
public bannerURL(options?: ImageURLOptions): string | null | undefined;
|
|
3567
|
+
public guildTagBadgeURL(options?: ImageURLOptions): string | null;
|
|
3562
3568
|
public createDM(force?: boolean): Promise<DMChannel>;
|
|
3563
3569
|
public deleteDM(): Promise<DMChannel>;
|
|
3564
3570
|
public displayAvatarURL(options?: ImageURLOptions): string;
|