discord.js 15.0.0-dev.1761177718-886d4a7fc → 15.0.0-dev.1761350521-756eac6bb
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 +7 -7
- package/src/managers/CachedManager.js +5 -5
- package/src/structures/ApplicationCommand.js +4 -5
- package/src/structures/CommandInteraction.js +1 -1
- package/src/structures/ModalComponentResolver.js +11 -0
- package/src/structures/ModalSubmitInteraction.js +19 -2
- package/src/util/Components.js +9 -1
- package/src/util/Options.js +9 -5
- package/typings/index.d.mts +33 -8
- package/typings/index.d.ts +33 -8
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.1761350521-756eac6bb",
|
|
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",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"magic-bytes.js": "^1.12.1",
|
|
62
62
|
"tslib": "^2.8.1",
|
|
63
63
|
"undici": "7.16.0",
|
|
64
|
-
"@discordjs/builders": "^2.0.0-dev.
|
|
65
|
-
"@discordjs/collection": "^3.0.0-dev.
|
|
66
|
-
"@discordjs/rest": "^3.0.0-dev.
|
|
67
|
-
"@discordjs/util": "^2.0.0-dev.
|
|
68
|
-
"@discordjs/
|
|
69
|
-
"@discordjs/
|
|
64
|
+
"@discordjs/builders": "^2.0.0-dev.1761350521-756eac6bb",
|
|
65
|
+
"@discordjs/collection": "^3.0.0-dev.1761350521-756eac6bb",
|
|
66
|
+
"@discordjs/rest": "^3.0.0-dev.1761350521-756eac6bb",
|
|
67
|
+
"@discordjs/util": "^2.0.0-dev.1761350521-756eac6bb",
|
|
68
|
+
"@discordjs/ws": "^3.0.0-dev.1761350521-756eac6bb",
|
|
69
|
+
"@discordjs/formatters": "^1.0.0-dev.1761350521-756eac6bb"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@favware/cliff-jumper": "^4.1.0",
|
|
@@ -22,11 +22,11 @@ class CachedManager extends DataManager {
|
|
|
22
22
|
* @name CachedManager#_cache
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(this, '_cache', {
|
|
25
|
-
value: this.client.options.makeCache(
|
|
26
|
-
|
|
27
|
-
this.
|
|
28
|
-
this.constructor,
|
|
29
|
-
),
|
|
25
|
+
value: this.client.options.makeCache({
|
|
26
|
+
holds: this.holds,
|
|
27
|
+
manager: this.constructor,
|
|
28
|
+
managerType: this.constructor[MakeCacheOverrideSymbol] ?? this.constructor,
|
|
29
|
+
}),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
if (iterable) {
|
|
@@ -136,11 +136,11 @@ class ApplicationCommand extends Base {
|
|
|
136
136
|
/**
|
|
137
137
|
* The options of this command
|
|
138
138
|
*
|
|
139
|
-
* @type {ApplicationCommandOption[]}
|
|
139
|
+
* @type {?ApplicationCommandOption[]}
|
|
140
140
|
*/
|
|
141
141
|
this.options = data.options.map(option => this.constructor.transformOption(option, true));
|
|
142
142
|
} else {
|
|
143
|
-
this.options ??=
|
|
143
|
+
this.options ??= null;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
if ('default_member_permissions' in data) {
|
|
@@ -436,9 +436,7 @@ class ApplicationCommand extends Base {
|
|
|
436
436
|
('version' in command && command.version !== this.version) ||
|
|
437
437
|
(command.type && command.type !== this.type) ||
|
|
438
438
|
('nsfw' in command && command.nsfw !== this.nsfw) ||
|
|
439
|
-
|
|
440
|
-
// TODO: remove ?? 0 on each when nullable
|
|
441
|
-
(command.options?.length ?? 0) !== (this.options?.length ?? 0) ||
|
|
439
|
+
command.options?.length !== this.options?.length ||
|
|
442
440
|
defaultMemberPermissions !== (this.defaultMemberPermissions?.bitfield ?? null) ||
|
|
443
441
|
!isEqual(command.nameLocalizations ?? command.name_localizations ?? {}, this.nameLocalizations ?? {}) ||
|
|
444
442
|
!isEqual(
|
|
@@ -452,6 +450,7 @@ class ApplicationCommand extends Base {
|
|
|
452
450
|
return false;
|
|
453
451
|
}
|
|
454
452
|
|
|
453
|
+
// Don't need to check both because we already checked the lengths above
|
|
455
454
|
if (command.options) {
|
|
456
455
|
return this.constructor.optionsEqual(this.options, command.options, enforceOptionOrder);
|
|
457
456
|
}
|
|
@@ -96,6 +96,7 @@ class CommandInteraction extends BaseInteraction {
|
|
|
96
96
|
* @property {Collection<Snowflake, GuildMember|APIGuildMember>} [members] The resolved guild members
|
|
97
97
|
* @property {Collection<Snowflake, Role|APIRole>} [roles] The resolved roles
|
|
98
98
|
* @property {Collection<Snowflake, BaseChannel|APIChannel>} [channels] The resolved channels
|
|
99
|
+
* @property {Collection<Snowflake, Attachment>} [attachments] The resolved attachments
|
|
99
100
|
*/
|
|
100
101
|
|
|
101
102
|
/**
|
|
@@ -103,7 +104,6 @@ class CommandInteraction extends BaseInteraction {
|
|
|
103
104
|
*
|
|
104
105
|
* @typedef {BaseInteractionResolvedData} CommandInteractionResolvedData
|
|
105
106
|
* @property {Collection<Snowflake, Message|APIMessage>} [messages] The resolved messages
|
|
106
|
-
* @property {Collection<Snowflake, Attachment>} [attachments] The resolved attachments
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
109
|
/**
|
|
@@ -222,6 +222,17 @@ class ModalComponentResolver {
|
|
|
222
222
|
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Gets file upload component
|
|
228
|
+
*
|
|
229
|
+
* @param {string} customId The custom id of the component
|
|
230
|
+
* @param {boolean} [required=false] Whether to throw an error if the component value is not found or empty
|
|
231
|
+
* @returns {?Collection<Snowflake, Attachment>} The uploaded files, or null if none were uploaded and not required
|
|
232
|
+
*/
|
|
233
|
+
getUploadedFiles(customId, required = false) {
|
|
234
|
+
return this._getTypedComponent(customId, [ComponentType.FileUpload], ['attachments'], required).attachments ?? null;
|
|
235
|
+
}
|
|
225
236
|
}
|
|
226
237
|
|
|
227
238
|
exports.ModalComponentResolver = ModalComponentResolver;
|
|
@@ -9,6 +9,7 @@ const { ModalComponentResolver } = require('./ModalComponentResolver.js');
|
|
|
9
9
|
const { InteractionResponses } = require('./interfaces/InteractionResponses.js');
|
|
10
10
|
|
|
11
11
|
const getMessage = lazy(() => require('./Message.js').Message);
|
|
12
|
+
const getAttachment = lazy(() => require('./Attachment.js').Attachment);
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* @typedef {Object} BaseModalData
|
|
@@ -26,6 +27,13 @@ const getMessage = lazy(() => require('./Message.js').Message);
|
|
|
26
27
|
* @property {Collection<string, BaseChannel|APIChannel>} [channels] The resolved channels
|
|
27
28
|
*/
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {BaseModalData} FileUploadModalData
|
|
32
|
+
* @property {string} customId The custom id of the file upload
|
|
33
|
+
* @property {string[]} values The values of the file upload
|
|
34
|
+
* @property {Collection<string, Attachment>} [attachments] The resolved attachments
|
|
35
|
+
*/
|
|
36
|
+
|
|
29
37
|
/**
|
|
30
38
|
* @typedef {BaseModalData} TextInputModalData
|
|
31
39
|
* @property {string} customId The custom id of the component
|
|
@@ -37,7 +45,7 @@ const getMessage = lazy(() => require('./Message.js').Message);
|
|
|
37
45
|
*/
|
|
38
46
|
|
|
39
47
|
/**
|
|
40
|
-
* @typedef {SelectMenuModalData|TextInputModalData} ModalData
|
|
48
|
+
* @typedef {SelectMenuModalData|TextInputModalData|FileUploadModalData} ModalData
|
|
41
49
|
*/
|
|
42
50
|
|
|
43
51
|
/**
|
|
@@ -155,7 +163,7 @@ class ModalSubmitInteraction extends BaseInteraction {
|
|
|
155
163
|
if (rawComponent.values) {
|
|
156
164
|
data.values = rawComponent.values;
|
|
157
165
|
if (resolved) {
|
|
158
|
-
const { members, users, channels, roles } = resolved;
|
|
166
|
+
const { members, users, channels, roles, attachments } = resolved;
|
|
159
167
|
const valueSet = new Set(rawComponent.values);
|
|
160
168
|
|
|
161
169
|
if (users) {
|
|
@@ -198,6 +206,15 @@ class ModalSubmitInteraction extends BaseInteraction {
|
|
|
198
206
|
}
|
|
199
207
|
}
|
|
200
208
|
}
|
|
209
|
+
|
|
210
|
+
if (attachments) {
|
|
211
|
+
data.attachments = new Collection();
|
|
212
|
+
for (const [id, attachment] of Object.entries(attachments)) {
|
|
213
|
+
if (valueSet.has(id)) {
|
|
214
|
+
data.attachments.set(id, new (getAttachment())(attachment));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
201
218
|
}
|
|
202
219
|
}
|
|
203
220
|
|
package/src/util/Components.js
CHANGED
|
@@ -24,7 +24,7 @@ const { ComponentType } = require('discord-api-types/v10');
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @typedef {StringSelectMenuComponentData|TextInputComponentData|UserSelectMenuComponentData|
|
|
27
|
-
* RoleSelectMenuComponentData|MentionableSelectMenuComponentData|ChannelSelectMenuComponentData} ComponentInLabelData
|
|
27
|
+
* RoleSelectMenuComponentData|MentionableSelectMenuComponentData|ChannelSelectMenuComponentData|FileUploadComponentData} ComponentInLabelData
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -44,6 +44,14 @@ const { ComponentType } = require('discord-api-types/v10');
|
|
|
44
44
|
* @property {string} [url] The URL of the button
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {BaseComponentData} FileUploadComponentData
|
|
49
|
+
* @property {string} customId The custom id of the file upload
|
|
50
|
+
* @property {number} [minValues] The minimum number of files that can be uploaded (0-10)
|
|
51
|
+
* @property {number} [maxValues] The maximum number of files that can be uploaded (1-10)
|
|
52
|
+
* @property {boolean} [required] Whether this component is required in modals
|
|
53
|
+
*/
|
|
54
|
+
|
|
47
55
|
/**
|
|
48
56
|
* @typedef {BaseComponentData} BaseSelectMenuComponentData
|
|
49
57
|
* @property {string} customId The custom id of the select menu
|
package/src/util/Options.js
CHANGED
|
@@ -5,12 +5,16 @@ const { DefaultWebSocketManagerOptions } = require('@discordjs/ws');
|
|
|
5
5
|
const { version } = require('../../package.json');
|
|
6
6
|
const { toSnakeCase } = require('./Transformers.js');
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Object} CacheFactoryParams
|
|
10
|
+
* @property {Function} holds The class that the cache will hold.
|
|
11
|
+
* @property {Function} manager The fully extended manager class the cache is being requested from.
|
|
12
|
+
* @property {Function} managerType The base manager class the cache is being requested from.
|
|
13
|
+
*/
|
|
14
|
+
|
|
9
15
|
/**
|
|
10
16
|
* @typedef {Function} CacheFactory
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {Function} holds The class that the cache will hold.
|
|
13
|
-
* @param {Function} manager The fully extended manager class the cache is being requested from.
|
|
17
|
+
* @param {CacheFactoryParams} params The parameters
|
|
14
18
|
* @returns {Collection} A Collection used to store the cache of the manager.
|
|
15
19
|
*/
|
|
16
20
|
|
|
@@ -121,7 +125,7 @@ class Options extends null {
|
|
|
121
125
|
const { Collection } = require('@discordjs/collection');
|
|
122
126
|
const { LimitedCollection } = require('./LimitedCollection.js');
|
|
123
127
|
|
|
124
|
-
return (managerType,
|
|
128
|
+
return ({ managerType, manager }) => {
|
|
125
129
|
const setting = settings[manager.name] ?? settings[managerType.name];
|
|
126
130
|
/* eslint-disable-next-line eqeqeq */
|
|
127
131
|
if (setting == null) {
|
package/typings/index.d.mts
CHANGED
|
@@ -274,11 +274,13 @@ export interface ActionRowData<ComponentType extends ActionRowComponentData | JS
|
|
|
274
274
|
|
|
275
275
|
export type ComponentInLabelData =
|
|
276
276
|
| ChannelSelectMenuComponentData
|
|
277
|
+
| FileUploadComponentData
|
|
277
278
|
| MentionableSelectMenuComponentData
|
|
278
279
|
| RoleSelectMenuComponentData
|
|
279
280
|
| StringSelectMenuComponentData
|
|
280
281
|
| TextInputComponentData
|
|
281
282
|
| UserSelectMenuComponentData;
|
|
283
|
+
|
|
282
284
|
export interface LabelData extends BaseComponentData {
|
|
283
285
|
component: ComponentInLabelData;
|
|
284
286
|
description?: string;
|
|
@@ -417,7 +419,7 @@ export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
|
|
|
417
419
|
public name: string;
|
|
418
420
|
public nameLocalizations: LocalizationMap | null;
|
|
419
421
|
public nameLocalized: string | null;
|
|
420
|
-
public options: (ApplicationCommandOption & { descriptionLocalized?: string; nameLocalized?: string })[];
|
|
422
|
+
public options: (ApplicationCommandOption & { descriptionLocalized?: string; nameLocalized?: string })[] | null;
|
|
421
423
|
public permissions: ApplicationCommandPermissionsManager<
|
|
422
424
|
PermissionsFetchType,
|
|
423
425
|
PermissionsFetchType,
|
|
@@ -2580,7 +2582,12 @@ export interface SelectMenuModalData<Cached extends CacheType = CacheType>
|
|
|
2580
2582
|
values: readonly string[];
|
|
2581
2583
|
}
|
|
2582
2584
|
|
|
2583
|
-
export
|
|
2585
|
+
export interface FileUploadModalData extends BaseModalData<ComponentType.FileUpload> {
|
|
2586
|
+
customId: string;
|
|
2587
|
+
files: readonly Attachment[];
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
export type ModalData = FileUploadModalData | SelectMenuModalData | TextInputModalData;
|
|
2584
2591
|
|
|
2585
2592
|
export interface LabelModalData extends BaseModalData<ComponentType.Label> {
|
|
2586
2593
|
component: readonly ModalData[];
|
|
@@ -2653,6 +2660,8 @@ export class ModalComponentResolver<Cached extends CacheType = CacheType> {
|
|
|
2653
2660
|
|
|
2654
2661
|
public getSelectedMentionables(customId: string, required: true): ModalSelectedMentionables<Cached>;
|
|
2655
2662
|
public getSelectedMentionables(customId: string, required?: boolean): ModalSelectedMentionables<Cached> | null;
|
|
2663
|
+
public getUploadedFiles(customId: string, required: true): ReadonlyCollection<Snowflake, Attachment>;
|
|
2664
|
+
public getUploadedFiles(customId: string, required?: boolean): ReadonlyCollection<Snowflake, Attachment> | null;
|
|
2656
2665
|
}
|
|
2657
2666
|
|
|
2658
2667
|
export interface ModalMessageModalSubmitInteraction<Cached extends CacheType = CacheType>
|
|
@@ -5359,13 +5368,21 @@ export type OverriddenCaches =
|
|
|
5359
5368
|
| 'GuildMessageManager'
|
|
5360
5369
|
| 'GuildTextThreadManager';
|
|
5361
5370
|
|
|
5371
|
+
export interface CacheFactoryParams<Manager extends keyof Caches> {
|
|
5372
|
+
holds: Caches[Manager][1];
|
|
5373
|
+
manager: CacheConstructors[keyof Caches];
|
|
5374
|
+
managerType: CacheConstructors[Exclude<keyof Caches, OverriddenCaches>];
|
|
5375
|
+
}
|
|
5376
|
+
|
|
5362
5377
|
// This doesn't actually work the way it looks 😢.
|
|
5363
5378
|
// Narrowing the type of `manager.name` doesn't propagate type information to `holds` and the return type.
|
|
5364
|
-
export type CacheFactory = (
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
) => (typeof manager)['prototype'] extends DataManager<infer Key, infer Value, any>
|
|
5379
|
+
export type CacheFactory = ({
|
|
5380
|
+
holds,
|
|
5381
|
+
manager,
|
|
5382
|
+
managerType,
|
|
5383
|
+
}: CacheFactoryParams<keyof Caches>) => (typeof manager)['prototype'] extends DataManager<infer Key, infer Value, any>
|
|
5384
|
+
? Collection<Key, Value>
|
|
5385
|
+
: never;
|
|
5369
5386
|
|
|
5370
5387
|
export type CacheWithLimitsOptions = {
|
|
5371
5388
|
[K in keyof Caches]?: Caches[K][0]['prototype'] extends DataManager<infer Key, infer Value, any>
|
|
@@ -5621,6 +5638,7 @@ export interface CommandInteractionOption<Cached extends CacheType = CacheType>
|
|
|
5621
5638
|
}
|
|
5622
5639
|
|
|
5623
5640
|
export interface BaseInteractionResolvedData<Cached extends CacheType = CacheType> {
|
|
5641
|
+
attachments?: ReadonlyCollection<Snowflake, Attachment>;
|
|
5624
5642
|
channels?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, Channel, APIInteractionDataResolvedChannel>>;
|
|
5625
5643
|
members?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, GuildMember, APIInteractionDataResolvedGuildMember>>;
|
|
5626
5644
|
roles?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
|
|
@@ -5629,7 +5647,6 @@ export interface BaseInteractionResolvedData<Cached extends CacheType = CacheTyp
|
|
|
5629
5647
|
|
|
5630
5648
|
export interface CommandInteractionResolvedData<Cached extends CacheType = CacheType>
|
|
5631
5649
|
extends BaseInteractionResolvedData<Cached> {
|
|
5632
|
-
attachments?: ReadonlyCollection<Snowflake, Attachment>;
|
|
5633
5650
|
messages?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, Message, APIMessage>>;
|
|
5634
5651
|
}
|
|
5635
5652
|
|
|
@@ -6838,6 +6855,14 @@ export interface TextInputComponentData extends BaseComponentData {
|
|
|
6838
6855
|
value?: string;
|
|
6839
6856
|
}
|
|
6840
6857
|
|
|
6858
|
+
export interface FileUploadComponentData extends BaseComponentData {
|
|
6859
|
+
customId: string;
|
|
6860
|
+
maxValues?: number;
|
|
6861
|
+
minValues?: number;
|
|
6862
|
+
required?: number;
|
|
6863
|
+
type: ComponentType.FileUpload;
|
|
6864
|
+
}
|
|
6865
|
+
|
|
6841
6866
|
export type MessageTarget =
|
|
6842
6867
|
| ChannelManager
|
|
6843
6868
|
| Interaction
|
package/typings/index.d.ts
CHANGED
|
@@ -274,11 +274,13 @@ export interface ActionRowData<ComponentType extends ActionRowComponentData | JS
|
|
|
274
274
|
|
|
275
275
|
export type ComponentInLabelData =
|
|
276
276
|
| ChannelSelectMenuComponentData
|
|
277
|
+
| FileUploadComponentData
|
|
277
278
|
| MentionableSelectMenuComponentData
|
|
278
279
|
| RoleSelectMenuComponentData
|
|
279
280
|
| StringSelectMenuComponentData
|
|
280
281
|
| TextInputComponentData
|
|
281
282
|
| UserSelectMenuComponentData;
|
|
283
|
+
|
|
282
284
|
export interface LabelData extends BaseComponentData {
|
|
283
285
|
component: ComponentInLabelData;
|
|
284
286
|
description?: string;
|
|
@@ -417,7 +419,7 @@ export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
|
|
|
417
419
|
public name: string;
|
|
418
420
|
public nameLocalizations: LocalizationMap | null;
|
|
419
421
|
public nameLocalized: string | null;
|
|
420
|
-
public options: (ApplicationCommandOption & { descriptionLocalized?: string; nameLocalized?: string })[];
|
|
422
|
+
public options: (ApplicationCommandOption & { descriptionLocalized?: string; nameLocalized?: string })[] | null;
|
|
421
423
|
public permissions: ApplicationCommandPermissionsManager<
|
|
422
424
|
PermissionsFetchType,
|
|
423
425
|
PermissionsFetchType,
|
|
@@ -2580,7 +2582,12 @@ export interface SelectMenuModalData<Cached extends CacheType = CacheType>
|
|
|
2580
2582
|
values: readonly string[];
|
|
2581
2583
|
}
|
|
2582
2584
|
|
|
2583
|
-
export
|
|
2585
|
+
export interface FileUploadModalData extends BaseModalData<ComponentType.FileUpload> {
|
|
2586
|
+
customId: string;
|
|
2587
|
+
files: readonly Attachment[];
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
export type ModalData = FileUploadModalData | SelectMenuModalData | TextInputModalData;
|
|
2584
2591
|
|
|
2585
2592
|
export interface LabelModalData extends BaseModalData<ComponentType.Label> {
|
|
2586
2593
|
component: readonly ModalData[];
|
|
@@ -2653,6 +2660,8 @@ export class ModalComponentResolver<Cached extends CacheType = CacheType> {
|
|
|
2653
2660
|
|
|
2654
2661
|
public getSelectedMentionables(customId: string, required: true): ModalSelectedMentionables<Cached>;
|
|
2655
2662
|
public getSelectedMentionables(customId: string, required?: boolean): ModalSelectedMentionables<Cached> | null;
|
|
2663
|
+
public getUploadedFiles(customId: string, required: true): ReadonlyCollection<Snowflake, Attachment>;
|
|
2664
|
+
public getUploadedFiles(customId: string, required?: boolean): ReadonlyCollection<Snowflake, Attachment> | null;
|
|
2656
2665
|
}
|
|
2657
2666
|
|
|
2658
2667
|
export interface ModalMessageModalSubmitInteraction<Cached extends CacheType = CacheType>
|
|
@@ -5359,13 +5368,21 @@ export type OverriddenCaches =
|
|
|
5359
5368
|
| 'GuildMessageManager'
|
|
5360
5369
|
| 'GuildTextThreadManager';
|
|
5361
5370
|
|
|
5371
|
+
export interface CacheFactoryParams<Manager extends keyof Caches> {
|
|
5372
|
+
holds: Caches[Manager][1];
|
|
5373
|
+
manager: CacheConstructors[keyof Caches];
|
|
5374
|
+
managerType: CacheConstructors[Exclude<keyof Caches, OverriddenCaches>];
|
|
5375
|
+
}
|
|
5376
|
+
|
|
5362
5377
|
// This doesn't actually work the way it looks 😢.
|
|
5363
5378
|
// Narrowing the type of `manager.name` doesn't propagate type information to `holds` and the return type.
|
|
5364
|
-
export type CacheFactory = (
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
) => (typeof manager)['prototype'] extends DataManager<infer Key, infer Value, any>
|
|
5379
|
+
export type CacheFactory = ({
|
|
5380
|
+
holds,
|
|
5381
|
+
manager,
|
|
5382
|
+
managerType,
|
|
5383
|
+
}: CacheFactoryParams<keyof Caches>) => (typeof manager)['prototype'] extends DataManager<infer Key, infer Value, any>
|
|
5384
|
+
? Collection<Key, Value>
|
|
5385
|
+
: never;
|
|
5369
5386
|
|
|
5370
5387
|
export type CacheWithLimitsOptions = {
|
|
5371
5388
|
[K in keyof Caches]?: Caches[K][0]['prototype'] extends DataManager<infer Key, infer Value, any>
|
|
@@ -5621,6 +5638,7 @@ export interface CommandInteractionOption<Cached extends CacheType = CacheType>
|
|
|
5621
5638
|
}
|
|
5622
5639
|
|
|
5623
5640
|
export interface BaseInteractionResolvedData<Cached extends CacheType = CacheType> {
|
|
5641
|
+
attachments?: ReadonlyCollection<Snowflake, Attachment>;
|
|
5624
5642
|
channels?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, Channel, APIInteractionDataResolvedChannel>>;
|
|
5625
5643
|
members?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, GuildMember, APIInteractionDataResolvedGuildMember>>;
|
|
5626
5644
|
roles?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
|
|
@@ -5629,7 +5647,6 @@ export interface BaseInteractionResolvedData<Cached extends CacheType = CacheTyp
|
|
|
5629
5647
|
|
|
5630
5648
|
export interface CommandInteractionResolvedData<Cached extends CacheType = CacheType>
|
|
5631
5649
|
extends BaseInteractionResolvedData<Cached> {
|
|
5632
|
-
attachments?: ReadonlyCollection<Snowflake, Attachment>;
|
|
5633
5650
|
messages?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, Message, APIMessage>>;
|
|
5634
5651
|
}
|
|
5635
5652
|
|
|
@@ -6838,6 +6855,14 @@ export interface TextInputComponentData extends BaseComponentData {
|
|
|
6838
6855
|
value?: string;
|
|
6839
6856
|
}
|
|
6840
6857
|
|
|
6858
|
+
export interface FileUploadComponentData extends BaseComponentData {
|
|
6859
|
+
customId: string;
|
|
6860
|
+
maxValues?: number;
|
|
6861
|
+
minValues?: number;
|
|
6862
|
+
required?: number;
|
|
6863
|
+
type: ComponentType.FileUpload;
|
|
6864
|
+
}
|
|
6865
|
+
|
|
6841
6866
|
export type MessageTarget =
|
|
6842
6867
|
| ChannelManager
|
|
6843
6868
|
| Interaction
|