lunibee 0.2.0 → 0.2.2
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/README.md +6 -6
- package/dist/builders/attachment.d.ts +5 -1
- package/dist/builders/commands.d.ts +131 -45
- package/dist/builders/components.d.ts +183 -41
- package/dist/builders/embed.d.ts +12 -8
- package/dist/builders/index.d.ts +9 -4
- package/dist/builders/index.js +234 -110
- package/dist/builders/index.js.map +8 -8
- package/dist/core/events.d.ts +28 -12
- package/dist/core/index.d.ts +5 -3
- package/dist/core/index.js +414 -78
- package/dist/core/index.js.map +18 -18
- package/dist/core/permissions.d.ts +6 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.js +869 -194
- package/dist/index.js.map +25 -24
- package/dist/managers/guild-resources.d.ts +22 -2
- package/dist/managers/guild.d.ts +3 -1
- package/dist/managers/index.d.ts +7 -3
- package/dist/managers/index.js +167 -33
- package/dist/managers/index.js.map +13 -13
- package/dist/managers/member.d.ts +13 -12
- package/dist/managers/message.d.ts +16 -4
- package/dist/rest/index.js +2 -2
- package/dist/rest/index.js.map +1 -1
- package/dist/sharding/index.js +3 -2
- package/dist/sharding/index.js.map +4 -4
- package/dist/structures/base.d.ts +36 -0
- package/dist/structures/index.d.ts +38 -3
- package/dist/structures/index.js +240 -34
- package/dist/structures/index.js.map +11 -11
- package/dist/structures/interactions.d.ts +110 -12
- package/dist/structures/options.d.ts +2 -0
- package/dist/structures/resources.d.ts +40 -4
- package/dist/types/gateway.d.ts +14 -0
- package/dist/types/index.d.ts +185 -10
- package/dist/types/index.js +37 -10
- package/dist/types/index.js.map +4 -4
- package/dist/utils/args.d.ts +79 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +190 -2
- package/dist/utils/index.js.map +5 -4
- package/dist/ws/index.js +2 -1
- package/dist/ws/index.js.map +4 -4
- package/package.json +14 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ButtonType } from "@lunibee/types";
|
|
2
|
+
export { ButtonType };
|
|
3
3
|
/** Component type constants exposed by Lunibee. */
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const ComponentEnum: {
|
|
5
5
|
readonly ActionRow: 1;
|
|
6
6
|
readonly Button: 2;
|
|
7
7
|
readonly StringSelect: 3;
|
|
@@ -19,17 +19,21 @@ export declare const ComponentType: {
|
|
|
19
19
|
readonly ContentInventoryEntry: 16;
|
|
20
20
|
readonly Container: 17;
|
|
21
21
|
};
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const TextInputType: {
|
|
23
23
|
readonly Short: 1;
|
|
24
24
|
readonly Paragraph: 2;
|
|
25
25
|
};
|
|
26
|
+
/** One {@link TextInputType} value, usable as a type. */
|
|
27
|
+
export type TextInputType = (typeof TextInputType)[keyof typeof TextInputType];
|
|
28
|
+
/** One {@link ComponentEnum} value, usable as a type. */
|
|
29
|
+
export type ComponentEnum = (typeof ComponentEnum)[keyof typeof ComponentEnum];
|
|
26
30
|
export interface APIComponentEmoji {
|
|
27
31
|
id?: string | null;
|
|
28
32
|
name?: string | null;
|
|
29
33
|
animated?: boolean;
|
|
30
34
|
}
|
|
31
35
|
export interface APIButtonComponent {
|
|
32
|
-
type: typeof
|
|
36
|
+
type: typeof ComponentEnum.Button;
|
|
33
37
|
style: 1 | 2 | 3 | 4 | 5 | 6;
|
|
34
38
|
custom_id?: string;
|
|
35
39
|
label?: string;
|
|
@@ -47,7 +51,7 @@ export interface APISelectOption {
|
|
|
47
51
|
default?: boolean;
|
|
48
52
|
}
|
|
49
53
|
export interface APIStringSelectComponent {
|
|
50
|
-
type: typeof
|
|
54
|
+
type: typeof ComponentEnum.StringSelect;
|
|
51
55
|
custom_id?: string;
|
|
52
56
|
placeholder?: string;
|
|
53
57
|
min_values?: number;
|
|
@@ -57,7 +61,7 @@ export interface APIStringSelectComponent {
|
|
|
57
61
|
options?: APISelectOption[];
|
|
58
62
|
}
|
|
59
63
|
export interface APIEntitySelectComponent {
|
|
60
|
-
type: typeof
|
|
64
|
+
type: typeof ComponentEnum.UserSelect | typeof ComponentEnum.RoleSelect | typeof ComponentEnum.MentionableSelect | typeof ComponentEnum.ChannelSelect;
|
|
61
65
|
custom_id?: string;
|
|
62
66
|
placeholder?: string;
|
|
63
67
|
min_values?: number;
|
|
@@ -67,8 +71,8 @@ export interface APIEntitySelectComponent {
|
|
|
67
71
|
default_values?: APISelectDefaultValue[];
|
|
68
72
|
}
|
|
69
73
|
export interface APITextInputComponent {
|
|
70
|
-
type: typeof
|
|
71
|
-
style: typeof
|
|
74
|
+
type: typeof ComponentEnum.TextInput;
|
|
75
|
+
style: typeof TextInputType.Short | typeof TextInputType.Paragraph;
|
|
72
76
|
custom_id?: string;
|
|
73
77
|
label?: string;
|
|
74
78
|
placeholder?: string;
|
|
@@ -79,26 +83,26 @@ export interface APITextInputComponent {
|
|
|
79
83
|
}
|
|
80
84
|
export interface APIModalComponent {
|
|
81
85
|
type: 9;
|
|
82
|
-
custom_id
|
|
83
|
-
title
|
|
86
|
+
custom_id: string;
|
|
87
|
+
title: string;
|
|
84
88
|
components: APIActionRowComponent[];
|
|
85
89
|
}
|
|
86
90
|
export type APIActionRowChild = APIButtonComponent | APIStringSelectComponent | APIEntitySelectComponent | APITextInputComponent;
|
|
87
91
|
export interface APIActionRowComponent {
|
|
88
|
-
type: typeof
|
|
92
|
+
type: typeof ComponentEnum.ActionRow;
|
|
89
93
|
components: APIActionRowChild[];
|
|
90
94
|
}
|
|
91
95
|
export interface APISectionComponent {
|
|
92
|
-
type: typeof
|
|
96
|
+
type: typeof ComponentEnum.Section;
|
|
93
97
|
components?: APIComponent[];
|
|
94
98
|
accessory?: APIComponent;
|
|
95
99
|
}
|
|
96
100
|
export interface APITextDisplayComponent {
|
|
97
|
-
type: typeof
|
|
101
|
+
type: typeof ComponentEnum.TextDisplay;
|
|
98
102
|
content: string;
|
|
99
103
|
}
|
|
100
104
|
export interface APIMediaGalleryComponent {
|
|
101
|
-
type: typeof
|
|
105
|
+
type: typeof ComponentEnum.MediaGallery;
|
|
102
106
|
items: {
|
|
103
107
|
media: {
|
|
104
108
|
url: string;
|
|
@@ -112,19 +116,19 @@ export interface APISelectDefaultValue {
|
|
|
112
116
|
type: "user" | "role" | "channel";
|
|
113
117
|
}
|
|
114
118
|
export interface APIFileComponent {
|
|
115
|
-
type: typeof
|
|
119
|
+
type: typeof ComponentEnum.File;
|
|
116
120
|
file: {
|
|
117
121
|
url: string;
|
|
118
122
|
};
|
|
119
123
|
spoiler?: boolean;
|
|
120
124
|
}
|
|
121
125
|
export interface APISeparatorComponent {
|
|
122
|
-
type: typeof
|
|
126
|
+
type: typeof ComponentEnum.Separator;
|
|
123
127
|
spacing?: 1 | 2;
|
|
124
128
|
divider?: boolean;
|
|
125
129
|
}
|
|
126
130
|
export interface APIThumbnailComponent {
|
|
127
|
-
type: typeof
|
|
131
|
+
type: typeof ComponentEnum.Thumbnail;
|
|
128
132
|
url: string;
|
|
129
133
|
proxy_url?: string;
|
|
130
134
|
width?: number;
|
|
@@ -133,17 +137,17 @@ export interface APIThumbnailComponent {
|
|
|
133
137
|
spoiler?: boolean;
|
|
134
138
|
}
|
|
135
139
|
export interface APIContentInventoryEntryComponent {
|
|
136
|
-
type: typeof
|
|
140
|
+
type: typeof ComponentEnum.ContentInventoryEntry;
|
|
137
141
|
id: string;
|
|
138
142
|
}
|
|
139
143
|
export interface APIContainerComponent {
|
|
140
|
-
type: typeof
|
|
144
|
+
type: typeof ComponentEnum.Container;
|
|
141
145
|
components: APIComponent[];
|
|
142
146
|
accent_color?: number;
|
|
143
147
|
spoiler?: boolean;
|
|
144
148
|
}
|
|
145
149
|
export type APIComponent = APIActionRowComponent | APIButtonComponent | APIStringSelectComponent | APIEntitySelectComponent | APITextInputComponent | APISectionComponent | APITextDisplayComponent | APIThumbnailComponent | APIMediaGalleryComponent | APIFileComponent | APISeparatorComponent | APIContentInventoryEntryComponent | APIContainerComponent;
|
|
146
|
-
export declare class
|
|
150
|
+
export declare class CreateActionRow<T extends {
|
|
147
151
|
toJSON(): APIActionRowChild;
|
|
148
152
|
} = {
|
|
149
153
|
toJSON(): APIActionRowChild;
|
|
@@ -153,7 +157,7 @@ export declare class ActionRowBuilder<T extends {
|
|
|
153
157
|
clearComponents(): this;
|
|
154
158
|
toJSON(): APIActionRowComponent;
|
|
155
159
|
}
|
|
156
|
-
export declare class
|
|
160
|
+
export declare class CreateStringSelect {
|
|
157
161
|
#private;
|
|
158
162
|
setCustomId(value: string): this;
|
|
159
163
|
setPlaceholder(value: string): this;
|
|
@@ -164,7 +168,7 @@ export declare class StringSelectBuilder {
|
|
|
164
168
|
addOptions(...options: APISelectOption[]): this;
|
|
165
169
|
toJSON(): APIStringSelectComponent;
|
|
166
170
|
}
|
|
167
|
-
export declare class
|
|
171
|
+
export declare class CreateButton {
|
|
168
172
|
#private;
|
|
169
173
|
/** Sets the style and drops fields that style cannot carry. */
|
|
170
174
|
setStyle(style: APIButtonComponent["style"]): this;
|
|
@@ -177,9 +181,9 @@ export declare class ButtonBuilder {
|
|
|
177
181
|
setDisabled(value?: boolean): this;
|
|
178
182
|
toJSON(): APIButtonComponent;
|
|
179
183
|
}
|
|
180
|
-
export declare class
|
|
184
|
+
export declare class CreateEntitySelect {
|
|
181
185
|
#private;
|
|
182
|
-
constructor(type: typeof
|
|
186
|
+
constructor(type: typeof ComponentEnum.UserSelect | typeof ComponentEnum.RoleSelect | typeof ComponentEnum.MentionableSelect | typeof ComponentEnum.ChannelSelect);
|
|
183
187
|
setCustomId(value: string): this;
|
|
184
188
|
setPlaceholder(value: string): this;
|
|
185
189
|
setMinValues(value: number): this;
|
|
@@ -189,16 +193,18 @@ export declare class EntitySelectBuilder {
|
|
|
189
193
|
setDefaultValues(...values: APISelectDefaultValue[]): this;
|
|
190
194
|
toJSON(): APIEntitySelectComponent;
|
|
191
195
|
}
|
|
192
|
-
export declare class
|
|
196
|
+
export declare class CreateModal {
|
|
193
197
|
#private;
|
|
194
198
|
setCustomId(value: string): this;
|
|
195
199
|
setTitle(value: string): this;
|
|
196
200
|
addComponents(...components: Array<{
|
|
197
201
|
toJSON(): APIActionRowComponent;
|
|
198
202
|
}>): this;
|
|
203
|
+
/** Adds text inputs, each in its own action row (Discord's modal layout). @param inputs Text inputs, at most 5 per modal. */
|
|
204
|
+
addTextInputs(...inputs: CreateTextInput[]): this;
|
|
199
205
|
toJSON(): APIModalComponent;
|
|
200
206
|
}
|
|
201
|
-
export declare class
|
|
207
|
+
export declare class CreateTextInput {
|
|
202
208
|
#private;
|
|
203
209
|
setStyle(style: APITextInputComponent["style"]): this;
|
|
204
210
|
setCustomId(value: string): this;
|
|
@@ -210,7 +216,7 @@ export declare class TextInputBuilder {
|
|
|
210
216
|
setValue(value: string): this;
|
|
211
217
|
toJSON(): APITextInputComponent;
|
|
212
218
|
}
|
|
213
|
-
export declare class
|
|
219
|
+
export declare class CreateContainer {
|
|
214
220
|
#private;
|
|
215
221
|
addComponents(...components: {
|
|
216
222
|
toJSON(): APIComponent;
|
|
@@ -220,7 +226,7 @@ export declare class ContainerBuilder {
|
|
|
220
226
|
setSpoiler(spoiler?: boolean): this;
|
|
221
227
|
toJSON(): APIContainerComponent;
|
|
222
228
|
}
|
|
223
|
-
export declare class
|
|
229
|
+
export declare class CreateSection {
|
|
224
230
|
#private;
|
|
225
231
|
addComponents(...components: {
|
|
226
232
|
toJSON(): APIComponent;
|
|
@@ -230,12 +236,12 @@ export declare class SectionBuilder {
|
|
|
230
236
|
}): this;
|
|
231
237
|
toJSON(): APISectionComponent;
|
|
232
238
|
}
|
|
233
|
-
export declare class
|
|
239
|
+
export declare class CreateTextDisplay {
|
|
234
240
|
#private;
|
|
235
241
|
setContent(content: string): this;
|
|
236
242
|
toJSON(): APITextDisplayComponent;
|
|
237
243
|
}
|
|
238
|
-
export declare class
|
|
244
|
+
export declare class CreateMediaGallery {
|
|
239
245
|
#private;
|
|
240
246
|
addItems(...items: {
|
|
241
247
|
url: string;
|
|
@@ -243,19 +249,19 @@ export declare class MediaGalleryBuilder {
|
|
|
243
249
|
}[]): this;
|
|
244
250
|
toJSON(): APIMediaGalleryComponent;
|
|
245
251
|
}
|
|
246
|
-
export declare class
|
|
252
|
+
export declare class CreateFileComponent {
|
|
247
253
|
#private;
|
|
248
254
|
setUrl(url: string): this;
|
|
249
255
|
setSpoiler(spoiler?: boolean): this;
|
|
250
256
|
toJSON(): APIFileComponent;
|
|
251
257
|
}
|
|
252
|
-
export declare class
|
|
258
|
+
export declare class CreateSeparator {
|
|
253
259
|
#private;
|
|
254
260
|
setSpacing(spacing: 1 | 2): this;
|
|
255
261
|
setDivider(divider?: boolean): this;
|
|
256
262
|
toJSON(): APISeparatorComponent;
|
|
257
263
|
}
|
|
258
|
-
export declare class
|
|
264
|
+
export declare class CreateThumbnail {
|
|
259
265
|
#private;
|
|
260
266
|
setUrl(url: string): this;
|
|
261
267
|
/** Sets the thumbnail's alt-text description. */
|
|
@@ -264,26 +270,162 @@ export declare class ThumbnailBuilder {
|
|
|
264
270
|
setSpoiler(spoiler?: boolean): this;
|
|
265
271
|
toJSON(): APIThumbnailComponent;
|
|
266
272
|
}
|
|
267
|
-
export declare class
|
|
273
|
+
export declare class CreateContentInventoryEntry {
|
|
268
274
|
#private;
|
|
269
275
|
setId(id: string): this;
|
|
270
276
|
toJSON(): APIContentInventoryEntryComponent;
|
|
271
277
|
}
|
|
272
|
-
/** Discord.js-familiar alias for {@link
|
|
273
|
-
export {
|
|
278
|
+
/** Discord.js-familiar alias for {@link CreateStringSelect}. */
|
|
279
|
+
export { CreateStringSelect as CreateStringSelectMenu };
|
|
274
280
|
/** User select menu builder (Discord.js-familiar). */
|
|
275
|
-
export declare class
|
|
281
|
+
export declare class CreateUserSelectMenu extends CreateEntitySelect {
|
|
276
282
|
constructor();
|
|
277
283
|
}
|
|
278
284
|
/** Role select menu builder (Discord.js-familiar). */
|
|
279
|
-
export declare class
|
|
285
|
+
export declare class CreateRoleSelectMenu extends CreateEntitySelect {
|
|
280
286
|
constructor();
|
|
281
287
|
}
|
|
282
288
|
/** Mentionable select menu builder (Discord.js-familiar). */
|
|
283
|
-
export declare class
|
|
289
|
+
export declare class CreateMentionableSelectMenu extends CreateEntitySelect {
|
|
284
290
|
constructor();
|
|
285
291
|
}
|
|
286
292
|
/** Channel select menu builder (Discord.js-familiar). */
|
|
287
|
-
export declare class
|
|
293
|
+
export declare class CreateChannelSelectMenu extends CreateEntitySelect {
|
|
288
294
|
constructor();
|
|
289
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* A message payload laid out with Components V2: the components, and the flag
|
|
298
|
+
* Discord requires for them. A V2 message cannot also carry `content` or `embeds`.
|
|
299
|
+
* @param components Top-level components (containers, sections, text displays, action rows...).
|
|
300
|
+
* @param options Extra message fields, such as `allowed_mentions` or `ephemeral`; `flags` are combined.
|
|
301
|
+
* @example channel.send(componentsV2Message(new CreateContainer().addComponents(new CreateTextDisplay().setContent("Hi"))))
|
|
302
|
+
*/
|
|
303
|
+
export declare function componentsV2Message<T extends Record<string, unknown> = Record<string, never>>(components: {
|
|
304
|
+
toJSON(): APIComponent;
|
|
305
|
+
} | Array<{
|
|
306
|
+
toJSON(): APIComponent;
|
|
307
|
+
}>, options?: T & {
|
|
308
|
+
flags?: number;
|
|
309
|
+
}): {
|
|
310
|
+
components: APIComponent[];
|
|
311
|
+
flags: number;
|
|
312
|
+
} & T;
|
|
313
|
+
/** @deprecated Use {@link CreateButton}. Removed in 2.0. */
|
|
314
|
+
export declare const ButtonBuilder: typeof CreateButton;
|
|
315
|
+
/** @deprecated Use {@link CreateButton}. Removed in 2.0. */
|
|
316
|
+
export type ButtonBuilder = CreateButton;
|
|
317
|
+
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in 2.0. */
|
|
318
|
+
export declare const ChannelSelectMenuBuilder: typeof CreateChannelSelectMenu;
|
|
319
|
+
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in 2.0. */
|
|
320
|
+
export type ChannelSelectMenuBuilder = CreateChannelSelectMenu;
|
|
321
|
+
/** @deprecated Use {@link CreateContainer}. Removed in 2.0. */
|
|
322
|
+
export declare const ContainerBuilder: typeof CreateContainer;
|
|
323
|
+
/** @deprecated Use {@link CreateContainer}. Removed in 2.0. */
|
|
324
|
+
export type ContainerBuilder = CreateContainer;
|
|
325
|
+
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in 2.0. */
|
|
326
|
+
export declare const ContentInventoryEntryBuilder: typeof CreateContentInventoryEntry;
|
|
327
|
+
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in 2.0. */
|
|
328
|
+
export type ContentInventoryEntryBuilder = CreateContentInventoryEntry;
|
|
329
|
+
/** @deprecated Use {@link CreateEntitySelect}. Removed in 2.0. */
|
|
330
|
+
export declare const EntitySelectBuilder: typeof CreateEntitySelect;
|
|
331
|
+
/** @deprecated Use {@link CreateEntitySelect}. Removed in 2.0. */
|
|
332
|
+
export type EntitySelectBuilder = CreateEntitySelect;
|
|
333
|
+
/** @deprecated Use {@link CreateFileComponent}. Removed in 2.0. */
|
|
334
|
+
export declare const FileComponentBuilder: typeof CreateFileComponent;
|
|
335
|
+
/** @deprecated Use {@link CreateFileComponent}. Removed in 2.0. */
|
|
336
|
+
export type FileComponentBuilder = CreateFileComponent;
|
|
337
|
+
/** @deprecated Use {@link CreateMediaGallery}. Removed in 2.0. */
|
|
338
|
+
export declare const MediaGalleryBuilder: typeof CreateMediaGallery;
|
|
339
|
+
/** @deprecated Use {@link CreateMediaGallery}. Removed in 2.0. */
|
|
340
|
+
export type MediaGalleryBuilder = CreateMediaGallery;
|
|
341
|
+
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in 2.0. */
|
|
342
|
+
export declare const MentionableSelectMenuBuilder: typeof CreateMentionableSelectMenu;
|
|
343
|
+
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in 2.0. */
|
|
344
|
+
export type MentionableSelectMenuBuilder = CreateMentionableSelectMenu;
|
|
345
|
+
/** @deprecated Use {@link CreateModal}. Removed in 2.0. */
|
|
346
|
+
export declare const ModalBuilder: typeof CreateModal;
|
|
347
|
+
/** @deprecated Use {@link CreateModal}. Removed in 2.0. */
|
|
348
|
+
export type ModalBuilder = CreateModal;
|
|
349
|
+
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in 2.0. */
|
|
350
|
+
export declare const RoleSelectMenuBuilder: typeof CreateRoleSelectMenu;
|
|
351
|
+
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in 2.0. */
|
|
352
|
+
export type RoleSelectMenuBuilder = CreateRoleSelectMenu;
|
|
353
|
+
/** @deprecated Use {@link CreateSection}. Removed in 2.0. */
|
|
354
|
+
export declare const SectionBuilder: typeof CreateSection;
|
|
355
|
+
/** @deprecated Use {@link CreateSection}. Removed in 2.0. */
|
|
356
|
+
export type SectionBuilder = CreateSection;
|
|
357
|
+
/** @deprecated Use {@link CreateSeparator}. Removed in 2.0. */
|
|
358
|
+
export declare const SeparatorBuilder: typeof CreateSeparator;
|
|
359
|
+
/** @deprecated Use {@link CreateSeparator}. Removed in 2.0. */
|
|
360
|
+
export type SeparatorBuilder = CreateSeparator;
|
|
361
|
+
/** @deprecated Use {@link CreateStringSelect}. Removed in 2.0. */
|
|
362
|
+
export declare const StringSelectBuilder: typeof CreateStringSelect;
|
|
363
|
+
/** @deprecated Use {@link CreateStringSelect}. Removed in 2.0. */
|
|
364
|
+
export type StringSelectBuilder = CreateStringSelect;
|
|
365
|
+
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in 2.0. */
|
|
366
|
+
export declare const StringSelectMenuBuilder: typeof CreateStringSelect;
|
|
367
|
+
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in 2.0. */
|
|
368
|
+
export type StringSelectMenuBuilder = CreateStringSelect;
|
|
369
|
+
/** @deprecated Use {@link CreateTextDisplay}. Removed in 2.0. */
|
|
370
|
+
export declare const TextDisplayBuilder: typeof CreateTextDisplay;
|
|
371
|
+
/** @deprecated Use {@link CreateTextDisplay}. Removed in 2.0. */
|
|
372
|
+
export type TextDisplayBuilder = CreateTextDisplay;
|
|
373
|
+
/** @deprecated Use {@link CreateTextInput}. Removed in 2.0. */
|
|
374
|
+
export declare const TextInputBuilder: typeof CreateTextInput;
|
|
375
|
+
/** @deprecated Use {@link CreateTextInput}. Removed in 2.0. */
|
|
376
|
+
export type TextInputBuilder = CreateTextInput;
|
|
377
|
+
/** @deprecated Use {@link CreateThumbnail}. Removed in 2.0. */
|
|
378
|
+
export declare const ThumbnailBuilder: typeof CreateThumbnail;
|
|
379
|
+
/** @deprecated Use {@link CreateThumbnail}. Removed in 2.0. */
|
|
380
|
+
export type ThumbnailBuilder = CreateThumbnail;
|
|
381
|
+
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in 2.0. */
|
|
382
|
+
export declare const UserSelectMenuBuilder: typeof CreateUserSelectMenu;
|
|
383
|
+
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in 2.0. */
|
|
384
|
+
export type UserSelectMenuBuilder = CreateUserSelectMenu;
|
|
385
|
+
/** @deprecated Use {@link CreateActionRow}. Removed in 2.0. */
|
|
386
|
+
export declare const ActionRowBuilder: typeof CreateActionRow;
|
|
387
|
+
/** @deprecated Use {@link CreateActionRow}. Removed in 2.0. */
|
|
388
|
+
export type ActionRowBuilder<T extends {
|
|
389
|
+
toJSON(): APIActionRowChild;
|
|
390
|
+
} = {
|
|
391
|
+
toJSON(): APIActionRowChild;
|
|
392
|
+
}> = CreateActionRow<T>;
|
|
393
|
+
/** @deprecated Use {@link ButtonType}. Removed in 2.0. */
|
|
394
|
+
export declare const ButtonStyle: {
|
|
395
|
+
readonly Primary: 1;
|
|
396
|
+
readonly Secondary: 2;
|
|
397
|
+
readonly Success: 3;
|
|
398
|
+
readonly Danger: 4;
|
|
399
|
+
readonly Link: 5;
|
|
400
|
+
readonly Premium: 6;
|
|
401
|
+
};
|
|
402
|
+
/** @deprecated Use {@link ButtonType}. Removed in 2.0. */
|
|
403
|
+
export type ButtonStyle = ButtonType;
|
|
404
|
+
/** @deprecated Use {@link TextInputType}. Removed in 2.0. */
|
|
405
|
+
export declare const TextInputStyle: {
|
|
406
|
+
readonly Short: 1;
|
|
407
|
+
readonly Paragraph: 2;
|
|
408
|
+
};
|
|
409
|
+
/** @deprecated Use {@link TextInputType}. Removed in 2.0. */
|
|
410
|
+
export type TextInputStyle = TextInputType;
|
|
411
|
+
/** @deprecated Use {@link ComponentEnum}. Removed in 2.0. */
|
|
412
|
+
export declare const ComponentType: {
|
|
413
|
+
readonly ActionRow: 1;
|
|
414
|
+
readonly Button: 2;
|
|
415
|
+
readonly StringSelect: 3;
|
|
416
|
+
readonly TextInput: 4;
|
|
417
|
+
readonly UserSelect: 5;
|
|
418
|
+
readonly RoleSelect: 6;
|
|
419
|
+
readonly MentionableSelect: 7;
|
|
420
|
+
readonly ChannelSelect: 8;
|
|
421
|
+
readonly Section: 9;
|
|
422
|
+
readonly TextDisplay: 10;
|
|
423
|
+
readonly Thumbnail: 11;
|
|
424
|
+
readonly MediaGallery: 12;
|
|
425
|
+
readonly File: 13;
|
|
426
|
+
readonly Separator: 14;
|
|
427
|
+
readonly ContentInventoryEntry: 16;
|
|
428
|
+
readonly Container: 17;
|
|
429
|
+
};
|
|
430
|
+
/** @deprecated Use {@link ComponentEnum}. Removed in 2.0. */
|
|
431
|
+
export type ComponentType = ComponentEnum;
|
package/dist/builders/embed.d.ts
CHANGED
|
@@ -33,21 +33,21 @@ export interface APIEmbed {
|
|
|
33
33
|
/** Embed fields. */ fields?: EmbedField[];
|
|
34
34
|
}
|
|
35
35
|
/** Builds compile-time-safe rich embed payloads for Discord API requests. */
|
|
36
|
-
export declare class
|
|
36
|
+
export declare class CreateEmbed {
|
|
37
37
|
#private;
|
|
38
|
-
/** Sets the embed title. @param value Title text. @returns This builder. @throws {RangeError} If title exceeds Discord's limit. */ setTitle(value: string): this;
|
|
39
|
-
/** Sets the embed description. @param value Description text. @returns This builder. @throws {RangeError} If description exceeds Discord's limit. */ setDescription(value: string): this;
|
|
40
|
-
/** Sets the embed URL. @param value Absolute URL. @returns This builder. @throws {TypeError} If URL is invalid. */ setURL(value: string): this;
|
|
38
|
+
/** Sets the embed title. @param value Title text, or null to clear. @returns This builder. @throws {RangeError} If title exceeds Discord's limit. */ setTitle(value: string | null): this;
|
|
39
|
+
/** Sets the embed description. @param value Description text, or null to clear. @returns This builder. @throws {RangeError} If description exceeds Discord's limit. */ setDescription(value: string | null): this;
|
|
40
|
+
/** Sets the embed URL. @param value Absolute URL, or null to clear. @returns This builder. @throws {TypeError} If URL is invalid. */ setURL(value: string | null): this;
|
|
41
41
|
/** Sets the embed color. @param value RGB integer. @returns This builder. @throws {RangeError} If color is outside 24-bit RGB range. */ setColor(value: number): this;
|
|
42
42
|
/** Sets the embed timestamp. @param value Date value. @returns This builder. @throws {RangeError} If date is invalid. */ setTimestamp(value?: Date): this;
|
|
43
43
|
/** Sets the embed footer. @param value Footer payload. @returns This builder. @throws {RangeError} If footer text exceeds Discord's limit. */ setFooter(value: EmbedFooter): this;
|
|
44
44
|
/** Sets the embed author. @param value Author payload. @returns This builder. @throws {RangeError} If author name exceeds Discord's limit. */ setAuthor(value: EmbedAuthor): this;
|
|
45
|
-
/** Sets the thumbnail URL. @param value Thumbnail URL or payload. @returns This builder. @throws {TypeError} If URL is invalid. */ setThumbnail(value: {
|
|
45
|
+
/** Sets the thumbnail URL. @param value Thumbnail URL or payload, or null to clear. @returns This builder. @throws {TypeError} If URL is invalid. */ setThumbnail(value: {
|
|
46
46
|
url: string;
|
|
47
|
-
} | string): this;
|
|
48
|
-
/** Sets the image URL. @param value Image URL or payload. @returns This builder. @throws {TypeError} If URL is invalid. */ setImage(value: {
|
|
47
|
+
} | string | null): this;
|
|
48
|
+
/** Sets the image URL. @param value Image URL or payload, or null to clear. @returns This builder. @throws {TypeError} If URL is invalid. */ setImage(value: {
|
|
49
49
|
url: string;
|
|
50
|
-
} | string): this;
|
|
50
|
+
} | string | null): this;
|
|
51
51
|
/** Adds embed fields. Accepts both the spread form `addFields(a, b)` and the
|
|
52
52
|
* single-array form `addFields([a, b])` for discord.js `RestOrArray` parity.
|
|
53
53
|
* @param fields Field payloads, spread or as a single array. @returns This builder. @throws {RangeError} If the 25-field limit is exceeded. */ addFields(...fields: EmbedField[] | [EmbedField[]]): this;
|
|
@@ -59,3 +59,7 @@ export declare class EmbedBuilder {
|
|
|
59
59
|
/** Returns a deep-cloned Discord API payload. @returns Strict embed payload. */ get data(): APIEmbed;
|
|
60
60
|
toJSON(): APIEmbed;
|
|
61
61
|
}
|
|
62
|
+
/** @deprecated Use {@link CreateEmbed}. Removed in 2.0. */
|
|
63
|
+
export declare const EmbedBuilder: typeof CreateEmbed;
|
|
64
|
+
/** @deprecated Use {@link CreateEmbed}. Removed in 2.0. */
|
|
65
|
+
export type EmbedBuilder = CreateEmbed;
|
package/dist/builders/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { CreateEmbed } from "./embed.js";
|
|
2
2
|
export type { EmbedField } from "./embed.js";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
3
|
+
export { CreateButton, ButtonType, ComponentEnum, CreateActionRow, CreateStringSelect, CreateStringSelectMenu, CreateEntitySelect, CreateUserSelectMenu, CreateRoleSelectMenu, CreateMentionableSelectMenu, CreateChannelSelectMenu, CreateModal, CreateTextInput, TextInputType, CreateContainer, CreateSection, CreateTextDisplay, CreateMediaGallery, CreateFileComponent, CreateSeparator, CreateThumbnail, CreateContentInventoryEntry, componentsV2Message, } from "./components.js";
|
|
4
|
+
export { CreateSlashCommand, CreateStringOption, CreateIntegerOption, CreateNumberOption, CreateBooleanOption, CreateUserOption, CreateChannelOption, CreateRoleOption, CreateMentionableOption, CreateAttachmentOption, CreateSubcommand, CreateSubcommandGroup, ApplicationCommandOptionEnum, CreateUserCommand, CreateMessageCommand, CreateContextMenuCommand, } from "./commands.js";
|
|
5
|
+
export { CreateAttachment, type AttachmentData } from "./attachment.js";
|
|
6
|
+
export { AttachmentBuilder } from "./attachment.js";
|
|
7
|
+
export { EmbedBuilder } from "./embed.js";
|
|
8
|
+
export { AttachmentOptionBuilder, BooleanOptionBuilder, ChannelOptionBuilder, CommandOptionBuilder, ContextMenuCommandBuilder, IntegerOptionBuilder, MentionableOptionBuilder, MessageCommandBuilder, NumberOptionBuilder, RoleOptionBuilder, SlashCommandBuilder, StringOptionBuilder, SubcommandBuilder, SubcommandGroupBuilder, UserCommandBuilder, UserOptionBuilder, ApplicationCommandOptionType, } from "./commands.js";
|
|
9
|
+
export { ButtonBuilder, ChannelSelectMenuBuilder, ContainerBuilder, ContentInventoryEntryBuilder, EntitySelectBuilder, FileComponentBuilder, MediaGalleryBuilder, MentionableSelectMenuBuilder, ModalBuilder, RoleSelectMenuBuilder, SectionBuilder, SeparatorBuilder, StringSelectBuilder, StringSelectMenuBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserSelectMenuBuilder, ActionRowBuilder, ButtonStyle, TextInputStyle, ComponentType, } from "./components.js";
|
|
10
|
+
export type { APIComponent, APIComponentEmoji, APIActionRowChild, APIActionRowComponent, APIButtonComponent, APISelectOption, APISelectDefaultValue, APIStringSelectComponent, APIEntitySelectComponent, APITextInputComponent, APIModalComponent, APIContainerComponent, APISectionComponent, APITextDisplayComponent, APIMediaGalleryComponent, APIFileComponent, APISeparatorComponent, APIThumbnailComponent, APIContentInventoryEntryComponent, } from "./components.js";
|