discord.js 15.0.0-dev.1752365791-3cff4d741 → 15.0.0-dev.1752538515-5a611be8d
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 +15 -16
- package/src/index.js +1 -0
- package/src/structures/ThreadChannel.js +1 -1
- package/src/structures/User.js +36 -1
- package/src/util/APITypes.js +5 -0
- package/src/util/Transformers.js +21 -0
- package/typings/index.d.mts +13 -0
- package/typings/index.d.ts +13 -0
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.1752538515-5a611be8d",
|
|
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",
|
|
@@ -55,37 +55,36 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@sapphire/snowflake": "3.5.5",
|
|
57
57
|
"@vladfrangu/async_event_emitter": "^2.4.6",
|
|
58
|
-
"discord-api-types": "^0.38.
|
|
58
|
+
"discord-api-types": "^0.38.16",
|
|
59
59
|
"fast-deep-equal": "3.1.3",
|
|
60
60
|
"lodash.snakecase": "4.1.1",
|
|
61
|
-
"magic-bytes.js": "^1.
|
|
61
|
+
"magic-bytes.js": "^1.12.1",
|
|
62
62
|
"tslib": "^2.8.1",
|
|
63
|
-
"undici": "7.
|
|
63
|
+
"undici": "7.11.0",
|
|
64
|
+
"@discordjs/builders": "^1.11.1",
|
|
64
65
|
"@discordjs/collection": "^2.1.1",
|
|
65
66
|
"@discordjs/formatters": "^0.6.1",
|
|
66
|
-
"@discordjs/builders": "^1.11.1",
|
|
67
67
|
"@discordjs/rest": "^2.5.0",
|
|
68
68
|
"@discordjs/util": "^1.1.1",
|
|
69
69
|
"@discordjs/ws": "^2.0.2"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@favware/cliff-jumper": "^4.1.0",
|
|
73
|
-
"@types/node": "^22.
|
|
73
|
+
"@types/node": "^22.16.3",
|
|
74
74
|
"cross-env": "^7.0.3",
|
|
75
|
-
"eslint": "^9.
|
|
75
|
+
"eslint": "^9.30.1",
|
|
76
76
|
"eslint-config-neon": "^0.2.7",
|
|
77
77
|
"eslint-formatter-compact": "^8.40.0",
|
|
78
|
-
"eslint-formatter-pretty": "^
|
|
79
|
-
"eslint-plugin-import": "^2.
|
|
80
|
-
"eslint-plugin-jsdoc": "^
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"turbo": "^2.5.2",
|
|
78
|
+
"eslint-formatter-pretty": "^6.0.1",
|
|
79
|
+
"eslint-plugin-import": "^2.32.0",
|
|
80
|
+
"eslint-plugin-jsdoc": "^51.3.4",
|
|
81
|
+
"prettier": "^3.6.2",
|
|
82
|
+
"tsd": "^0.32.0",
|
|
83
|
+
"turbo": "^2.5.4",
|
|
85
84
|
"typescript": "~5.8.3",
|
|
85
|
+
"@discordjs/api-extractor": "^7.52.7",
|
|
86
86
|
"@discordjs/docgen": "^0.12.1",
|
|
87
|
-
"@discordjs/scripts": "^0.1.0"
|
|
88
|
-
"@discordjs/api-extractor": "^7.52.7"
|
|
87
|
+
"@discordjs/scripts": "^0.1.0"
|
|
89
88
|
},
|
|
90
89
|
"engines": {
|
|
91
90
|
"node": ">=22.12.0"
|
package/src/index.js
CHANGED
|
@@ -144,6 +144,7 @@ exports.Component = require('./structures/Component.js').Component;
|
|
|
144
144
|
exports.ContainerComponent = require('./structures/ContainerComponent.js').ContainerComponent;
|
|
145
145
|
exports.ContextMenuCommandInteraction =
|
|
146
146
|
require('./structures/ContextMenuCommandInteraction.js').ContextMenuCommandInteraction;
|
|
147
|
+
exports.DirectoryChannel = require('./structures/DirectoryChannel.js').DirectoryChannel;
|
|
147
148
|
exports.DMChannel = require('./structures/DMChannel.js').DMChannel;
|
|
148
149
|
exports.Embed = require('./structures/Embed.js').Embed;
|
|
149
150
|
exports.Emoji = require('./structures/Emoji.js').Emoji;
|
|
@@ -375,7 +375,7 @@ class ThreadChannel extends BaseChannel {
|
|
|
375
375
|
async edit(options) {
|
|
376
376
|
const newData = await this.client.rest.patch(Routes.channel(this.id), {
|
|
377
377
|
body: {
|
|
378
|
-
name:
|
|
378
|
+
name: options.name,
|
|
379
379
|
archived: options.archived,
|
|
380
380
|
auto_archive_duration: options.autoArchiveDuration,
|
|
381
381
|
rate_limit_per_user: options.rateLimitPerUser,
|
package/src/structures/User.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const { userMention } = require('@discordjs/formatters');
|
|
4
4
|
const { calculateUserDefaultAvatarIndex } = require('@discordjs/rest');
|
|
5
5
|
const { DiscordSnowflake } = require('@sapphire/snowflake');
|
|
6
|
+
const { _transformCollectibles } = require('../util/Transformers.js');
|
|
6
7
|
const { UserFlagsBitField } = require('../util/UserFlagsBitField.js');
|
|
7
8
|
const { Base } = require('./Base.js');
|
|
8
9
|
|
|
@@ -151,6 +152,30 @@ class User extends Base {
|
|
|
151
152
|
} else {
|
|
152
153
|
this.avatarDecorationData = null;
|
|
153
154
|
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @typedef {Object} NameplateData
|
|
158
|
+
* @property {Snowflake} skuId The id of the nameplate's SKU
|
|
159
|
+
* @property {string} asset The nameplate's asset path
|
|
160
|
+
* @property {string} label The nameplate's label
|
|
161
|
+
* @property {NameplatePalette} palette Background color of the nameplate
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @typedef {Object} Collectibles
|
|
166
|
+
* @property {?NameplateData} nameplate The user's nameplate data
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
if (data.collectibles) {
|
|
170
|
+
/**
|
|
171
|
+
* The user's collectibles
|
|
172
|
+
*
|
|
173
|
+
* @type {?Collectibles}
|
|
174
|
+
*/
|
|
175
|
+
this.collectibles = _transformCollectibles(data.collectibles);
|
|
176
|
+
} else {
|
|
177
|
+
this.collectibles = null;
|
|
178
|
+
}
|
|
154
179
|
}
|
|
155
180
|
|
|
156
181
|
/**
|
|
@@ -338,7 +363,11 @@ class User extends Base {
|
|
|
338
363
|
this.banner === user.banner &&
|
|
339
364
|
this.accentColor === user.accentColor &&
|
|
340
365
|
this.avatarDecorationData?.asset === user.avatarDecorationData?.asset &&
|
|
341
|
-
this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId
|
|
366
|
+
this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId &&
|
|
367
|
+
this.collectibles?.nameplate?.skuId === user.collectibles?.nameplate?.skuId &&
|
|
368
|
+
this.collectibles?.nameplate?.asset === user.collectibles?.nameplate?.asset &&
|
|
369
|
+
this.collectibles?.nameplate?.label === user.collectibles?.nameplate?.label &&
|
|
370
|
+
this.collectibles?.nameplate?.palette === user.collectibles?.nameplate?.palette
|
|
342
371
|
);
|
|
343
372
|
}
|
|
344
373
|
|
|
@@ -363,6 +392,12 @@ class User extends Base {
|
|
|
363
392
|
('avatar_decoration_data' in user
|
|
364
393
|
? this.avatarDecorationData?.asset === user.avatar_decoration_data?.asset &&
|
|
365
394
|
this.avatarDecorationData?.skuId === user.avatar_decoration_data?.sku_id
|
|
395
|
+
: true) &&
|
|
396
|
+
('collectibles' in user
|
|
397
|
+
? this.collectibles?.nameplate?.skuId === user.collectibles?.nameplate?.sku_id &&
|
|
398
|
+
this.collectibles?.nameplate?.asset === user.collectibles?.nameplate?.asset &&
|
|
399
|
+
this.collectibles?.nameplate?.label === user.collectibles?.nameplate?.label &&
|
|
400
|
+
this.collectibles?.nameplate?.palette === user.collectibles?.nameplate?.palette
|
|
366
401
|
: true)
|
|
367
402
|
);
|
|
368
403
|
}
|
package/src/util/APITypes.js
CHANGED
|
@@ -549,6 +549,11 @@
|
|
|
549
549
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/MessageFlags}
|
|
550
550
|
*/
|
|
551
551
|
|
|
552
|
+
/**
|
|
553
|
+
* @external NameplatePalette
|
|
554
|
+
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/NameplatePalette}
|
|
555
|
+
*/
|
|
556
|
+
|
|
552
557
|
/**
|
|
553
558
|
* @external OAuth2Scopes
|
|
554
559
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/OAuth2Scopes}
|
package/src/util/Transformers.js
CHANGED
|
@@ -92,8 +92,29 @@ function _transformAPIIncidentsData(data) {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Transforms a collectibles object to a camel-cased variant.
|
|
97
|
+
*
|
|
98
|
+
* @param {APICollectibles} collectibles The collectibles to transform
|
|
99
|
+
* @returns {Collectibles}
|
|
100
|
+
* @ignore
|
|
101
|
+
*/
|
|
102
|
+
function _transformCollectibles(collectibles) {
|
|
103
|
+
if (!collectibles.nameplate) return { nameplate: null };
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
nameplate: {
|
|
107
|
+
skuId: collectibles.nameplate.sku_id,
|
|
108
|
+
asset: collectibles.nameplate.asset,
|
|
109
|
+
label: collectibles.nameplate.label,
|
|
110
|
+
palette: collectibles.nameplate.palette,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
95
115
|
exports.toSnakeCase = toSnakeCase;
|
|
96
116
|
exports._transformAPIAutoModerationAction = _transformAPIAutoModerationAction;
|
|
97
117
|
exports._transformAPIMessageInteractionMetadata = _transformAPIMessageInteractionMetadata;
|
|
98
118
|
exports._transformGuildScheduledEventRecurrenceRule = _transformGuildScheduledEventRecurrenceRule;
|
|
99
119
|
exports._transformAPIIncidentsData = _transformAPIIncidentsData;
|
|
120
|
+
exports._transformCollectibles = _transformCollectibles;
|
package/typings/index.d.mts
CHANGED
|
@@ -170,6 +170,7 @@ import {
|
|
|
170
170
|
MessageFlags,
|
|
171
171
|
MessageReferenceType,
|
|
172
172
|
MessageType,
|
|
173
|
+
NameplatePalette,
|
|
173
174
|
OAuth2Scopes,
|
|
174
175
|
OverwriteType,
|
|
175
176
|
PermissionFlagsBits,
|
|
@@ -3509,6 +3510,17 @@ export interface AvatarDecorationData {
|
|
|
3509
3510
|
skuId: Snowflake;
|
|
3510
3511
|
}
|
|
3511
3512
|
|
|
3513
|
+
export interface NameplateData {
|
|
3514
|
+
asset: string;
|
|
3515
|
+
label: string;
|
|
3516
|
+
palette: NameplatePalette;
|
|
3517
|
+
skuId: Snowflake;
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3520
|
+
export interface Collectibles {
|
|
3521
|
+
nameplate: NameplateData | null;
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3512
3524
|
export interface UnfurledMediaItemData {
|
|
3513
3525
|
url: string;
|
|
3514
3526
|
}
|
|
@@ -3531,6 +3543,7 @@ export class User extends Base {
|
|
|
3531
3543
|
public bot: boolean;
|
|
3532
3544
|
public get createdAt(): Date;
|
|
3533
3545
|
public get createdTimestamp(): number;
|
|
3546
|
+
public collectibles: Collectibles | null;
|
|
3534
3547
|
public discriminator: string;
|
|
3535
3548
|
public get displayName(): string;
|
|
3536
3549
|
public get defaultAvatarURL(): string;
|
package/typings/index.d.ts
CHANGED
|
@@ -170,6 +170,7 @@ import {
|
|
|
170
170
|
MessageFlags,
|
|
171
171
|
MessageReferenceType,
|
|
172
172
|
MessageType,
|
|
173
|
+
NameplatePalette,
|
|
173
174
|
OAuth2Scopes,
|
|
174
175
|
OverwriteType,
|
|
175
176
|
PermissionFlagsBits,
|
|
@@ -3509,6 +3510,17 @@ export interface AvatarDecorationData {
|
|
|
3509
3510
|
skuId: Snowflake;
|
|
3510
3511
|
}
|
|
3511
3512
|
|
|
3513
|
+
export interface NameplateData {
|
|
3514
|
+
asset: string;
|
|
3515
|
+
label: string;
|
|
3516
|
+
palette: NameplatePalette;
|
|
3517
|
+
skuId: Snowflake;
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3520
|
+
export interface Collectibles {
|
|
3521
|
+
nameplate: NameplateData | null;
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3512
3524
|
export interface UnfurledMediaItemData {
|
|
3513
3525
|
url: string;
|
|
3514
3526
|
}
|
|
@@ -3531,6 +3543,7 @@ export class User extends Base {
|
|
|
3531
3543
|
public bot: boolean;
|
|
3532
3544
|
public get createdAt(): Date;
|
|
3533
3545
|
public get createdTimestamp(): number;
|
|
3546
|
+
public collectibles: Collectibles | null;
|
|
3534
3547
|
public discriminator: string;
|
|
3535
3548
|
public get displayName(): string;
|
|
3536
3549
|
public get defaultAvatarURL(): string;
|