seyfert 3.0.1-dev-14564036360.0 → 3.0.1-dev-14656752310.0

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.
Files changed (62) hide show
  1. package/lib/api/Routes/webhooks.d.ts +2 -2
  2. package/lib/builders/ActionRow.d.ts +3 -3
  3. package/lib/builders/ActionRow.js +2 -2
  4. package/lib/builders/Button.d.ts +2 -11
  5. package/lib/builders/Button.js +3 -15
  6. package/lib/builders/Container.d.ts +68 -0
  7. package/lib/builders/Container.js +86 -0
  8. package/lib/builders/File.d.ts +37 -0
  9. package/lib/builders/File.js +52 -0
  10. package/lib/builders/MediaGallery.d.ts +80 -0
  11. package/lib/builders/MediaGallery.js +110 -0
  12. package/lib/builders/Section.d.ts +29 -0
  13. package/lib/builders/Section.js +50 -0
  14. package/lib/builders/Separator.d.ts +39 -0
  15. package/lib/builders/Separator.js +54 -0
  16. package/lib/builders/TextDisplay.d.ts +29 -0
  17. package/lib/builders/TextDisplay.js +41 -0
  18. package/lib/builders/Thumbnail.d.ts +43 -0
  19. package/lib/builders/Thumbnail.js +61 -0
  20. package/lib/builders/index.d.ts +10 -4
  21. package/lib/builders/index.js +29 -1
  22. package/lib/builders/types.d.ts +11 -1
  23. package/lib/cache/resources/guilds.d.ts +9 -3
  24. package/lib/cache/resources/members.js +32 -12
  25. package/lib/common/types/write.d.ts +3 -3
  26. package/lib/components/ActionRow.d.ts +1 -1
  27. package/lib/components/BaseComponent.d.ts +27 -2
  28. package/lib/components/Container.d.ts +10 -0
  29. package/lib/components/Container.js +22 -0
  30. package/lib/components/File.d.ts +7 -0
  31. package/lib/components/File.js +16 -0
  32. package/lib/components/MediaGallery.d.ts +6 -0
  33. package/lib/components/MediaGallery.js +13 -0
  34. package/lib/components/Section.d.ts +12 -0
  35. package/lib/components/Section.js +21 -0
  36. package/lib/components/Separator.d.ts +7 -0
  37. package/lib/components/Separator.js +16 -0
  38. package/lib/components/TextDisplay.d.ts +5 -0
  39. package/lib/components/TextDisplay.js +10 -0
  40. package/lib/components/Thumbnail.d.ts +8 -0
  41. package/lib/components/Thumbnail.js +19 -0
  42. package/lib/components/index.d.ts +13 -3
  43. package/lib/components/index.js +27 -0
  44. package/lib/events/hooks/interactions.d.ts +1 -1
  45. package/lib/structures/Interaction.d.ts +1 -1
  46. package/lib/structures/Interaction.js +3 -1
  47. package/lib/structures/Message.d.ts +2 -3
  48. package/lib/structures/Message.js +1 -2
  49. package/lib/structures/Webhook.d.ts +2 -2
  50. package/lib/structures/channels.js +2 -2
  51. package/lib/types/payloads/_interactions/messageComponents.d.ts +1 -2
  52. package/lib/types/payloads/_interactions/modalSubmit.d.ts +1 -2
  53. package/lib/types/payloads/_interactions/responses.d.ts +1 -2
  54. package/lib/types/payloads/channel.d.ts +11 -332
  55. package/lib/types/payloads/channel.js +9 -111
  56. package/lib/types/payloads/components.d.ts +489 -0
  57. package/lib/types/payloads/components.js +148 -0
  58. package/lib/types/payloads/index.d.ts +1 -0
  59. package/lib/types/payloads/index.js +1 -0
  60. package/lib/types/rest/channel.d.ts +3 -3
  61. package/lib/types/rest/webhook.d.ts +12 -4
  62. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  * Types extracted from https://discord.com/developers/docs/resources/channel
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ChannelFlags = exports.SelectMenuDefaultValueType = exports.TextInputStyle = exports.ButtonStyle = exports.ComponentType = exports.AllowedMentionsTypes = exports.AttachmentFlags = exports.EmbedType = exports.ThreadMemberFlags = exports.ThreadAutoArchiveDuration = exports.MessageFlags = exports.MessageActivityType = exports.MessageReferenceType = exports.MessageType = exports.ForumLayoutType = exports.SortOrderType = void 0;
6
+ exports.AllowedMentionsTypes = exports.AttachmentFlags = exports.EmbedType = exports.ThreadMemberFlags = exports.ThreadAutoArchiveDuration = exports.MessageFlags = exports.MessageActivityType = exports.MessageReferenceType = exports.MessageType = exports.ForumLayoutType = exports.SortOrderType = void 0;
7
7
  /**
8
8
  * https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
9
9
  */
@@ -160,6 +160,14 @@ var MessageFlags;
160
160
  * This message is a voice message
161
161
  */
162
162
  MessageFlags[MessageFlags["IsVoiceMessage"] = 8192] = "IsVoiceMessage";
163
+ /**
164
+ * This message has a snapshot (via Message Forwarding)
165
+ */
166
+ MessageFlags[MessageFlags["HasSnapshot"] = 16384] = "HasSnapshot";
167
+ /**
168
+ * This message allows you to create fully component driven messages
169
+ */
170
+ MessageFlags[MessageFlags["IsComponentsV2"] = 32768] = "IsComponentsV2";
163
171
  })(MessageFlags || (exports.MessageFlags = MessageFlags = {}));
164
172
  var ThreadAutoArchiveDuration;
165
173
  (function (ThreadAutoArchiveDuration) {
@@ -257,113 +265,3 @@ var AllowedMentionsTypes;
257
265
  */
258
266
  AllowedMentionsTypes["User"] = "users";
259
267
  })(AllowedMentionsTypes || (exports.AllowedMentionsTypes = AllowedMentionsTypes = {}));
260
- /**
261
- * https://discord.com/developers/docs/interactions/message-components#component-object-component-types
262
- */
263
- var ComponentType;
264
- (function (ComponentType) {
265
- /**
266
- * Action Row component
267
- */
268
- ComponentType[ComponentType["ActionRow"] = 1] = "ActionRow";
269
- /**
270
- * Button component
271
- */
272
- ComponentType[ComponentType["Button"] = 2] = "Button";
273
- /**
274
- * Select menu for picking from defined text options
275
- */
276
- ComponentType[ComponentType["StringSelect"] = 3] = "StringSelect";
277
- /**
278
- * Text Input component
279
- */
280
- ComponentType[ComponentType["TextInput"] = 4] = "TextInput";
281
- /**
282
- * Select menu for users
283
- */
284
- ComponentType[ComponentType["UserSelect"] = 5] = "UserSelect";
285
- /**
286
- * Select menu for roles
287
- */
288
- ComponentType[ComponentType["RoleSelect"] = 6] = "RoleSelect";
289
- /**
290
- * Select menu for users and roles
291
- */
292
- ComponentType[ComponentType["MentionableSelect"] = 7] = "MentionableSelect";
293
- /**
294
- * Select menu for channels
295
- */
296
- ComponentType[ComponentType["ChannelSelect"] = 8] = "ChannelSelect";
297
- })(ComponentType || (exports.ComponentType = ComponentType = {}));
298
- /**
299
- * https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
300
- */
301
- var ButtonStyle;
302
- (function (ButtonStyle) {
303
- ButtonStyle[ButtonStyle["Primary"] = 1] = "Primary";
304
- ButtonStyle[ButtonStyle["Secondary"] = 2] = "Secondary";
305
- ButtonStyle[ButtonStyle["Success"] = 3] = "Success";
306
- ButtonStyle[ButtonStyle["Danger"] = 4] = "Danger";
307
- ButtonStyle[ButtonStyle["Link"] = 5] = "Link";
308
- ButtonStyle[ButtonStyle["Premium"] = 6] = "Premium";
309
- })(ButtonStyle || (exports.ButtonStyle = ButtonStyle = {}));
310
- /**
311
- * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles
312
- */
313
- var TextInputStyle;
314
- (function (TextInputStyle) {
315
- TextInputStyle[TextInputStyle["Short"] = 1] = "Short";
316
- TextInputStyle[TextInputStyle["Paragraph"] = 2] = "Paragraph";
317
- })(TextInputStyle || (exports.TextInputStyle = TextInputStyle = {}));
318
- /**
319
- * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
320
- */
321
- var SelectMenuDefaultValueType;
322
- (function (SelectMenuDefaultValueType) {
323
- SelectMenuDefaultValueType["Channel"] = "channel";
324
- SelectMenuDefaultValueType["Role"] = "role";
325
- SelectMenuDefaultValueType["User"] = "user";
326
- })(SelectMenuDefaultValueType || (exports.SelectMenuDefaultValueType = SelectMenuDefaultValueType = {}));
327
- /**
328
- * https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
329
- */
330
- var ChannelFlags;
331
- (function (ChannelFlags) {
332
- /**
333
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
334
- */
335
- ChannelFlags[ChannelFlags["GuildFeedRemoved"] = 1] = "GuildFeedRemoved";
336
- /**
337
- * This thread is pinned to the top of its parent forum channel
338
- */
339
- ChannelFlags[ChannelFlags["Pinned"] = 2] = "Pinned";
340
- /**
341
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
342
- */
343
- ChannelFlags[ChannelFlags["ActiveChannelsRemoved"] = 4] = "ActiveChannelsRemoved";
344
- /**
345
- * Whether a tag is required to be specified when creating a thread in a forum channel.
346
- * Tags are specified in the `applied_tags` field
347
- */
348
- ChannelFlags[ChannelFlags["RequireTag"] = 16] = "RequireTag";
349
- /**
350
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
351
- */
352
- ChannelFlags[ChannelFlags["IsSpam"] = 32] = "IsSpam";
353
- /**
354
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
355
- */
356
- ChannelFlags[ChannelFlags["IsGuildResourceChannel"] = 128] = "IsGuildResourceChannel";
357
- /**
358
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
359
- */
360
- ChannelFlags[ChannelFlags["ClydeAI"] = 256] = "ClydeAI";
361
- /**
362
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
363
- */
364
- ChannelFlags[ChannelFlags["IsScheduledForDeletion"] = 512] = "IsScheduledForDeletion";
365
- /**
366
- * Whether media download options are hidden.
367
- */
368
- ChannelFlags[ChannelFlags["HideMediaDownloadOptions"] = 32768] = "HideMediaDownloadOptions";
369
- })(ChannelFlags || (exports.ChannelFlags = ChannelFlags = {}));
@@ -0,0 +1,489 @@
1
+ import type { APIAttachment, Snowflake } from '..';
2
+ import type { Identify, MakeRequired } from '../../common';
3
+ import type { ChannelType } from '../utils';
4
+ /**
5
+ * https://discord.com/developers/docs/interactions/message-components#component-object
6
+ */
7
+ export interface APIBaseComponent<T extends ComponentType> {
8
+ /**
9
+ * The type of the component
10
+ */
11
+ type: T;
12
+ }
13
+ /**
14
+ * https://discord.com/developers/docs/interactions/message-components#component-object-component-types
15
+ */
16
+ export declare enum ComponentType {
17
+ /**
18
+ * Action Row component
19
+ */
20
+ ActionRow = 1,
21
+ /**
22
+ * Button component
23
+ */
24
+ Button = 2,
25
+ /**
26
+ * Select menu for picking from defined text options
27
+ */
28
+ StringSelect = 3,
29
+ /**
30
+ * Text Input component
31
+ */
32
+ TextInput = 4,
33
+ /**
34
+ * Select menu for users
35
+ */
36
+ UserSelect = 5,
37
+ /**
38
+ * Select menu for roles
39
+ */
40
+ RoleSelect = 6,
41
+ /**
42
+ * Select menu for users and roles
43
+ */
44
+ MentionableSelect = 7,
45
+ /**
46
+ * Select menu for channels
47
+ */
48
+ ChannelSelect = 8,
49
+ /**
50
+ * Section for accessory
51
+ */
52
+ Section = 9,
53
+ /**
54
+ * Text display component
55
+ */
56
+ TextDisplay = 10,
57
+ /**
58
+ * Thumbnail component
59
+ */
60
+ Thumbnail = 11,
61
+ /**
62
+ * Media Gallery component
63
+ */
64
+ MediaGallery = 12,
65
+ /**
66
+ * File component
67
+ */
68
+ File = 13,
69
+ /**
70
+ * Separator component
71
+ */
72
+ Separator = 14,
73
+ /**
74
+ * Container component
75
+ */
76
+ Container = 17
77
+ }
78
+ /**
79
+ * https://discord.com/developers/docs/interactions/message-components#action-rows
80
+ */
81
+ export interface APIActionRowComponent<T extends APIActionRowComponentTypes> extends APIBaseComponent<ComponentType.ActionRow> {
82
+ /**
83
+ * The components in the ActionRow
84
+ */
85
+ components: T[];
86
+ }
87
+ /**
88
+ * https://discord.com/developers/docs/interactions/message-components#buttons
89
+ */
90
+ export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
91
+ /**
92
+ * The label to be displayed on the button
93
+ */
94
+ label?: string;
95
+ /**
96
+ * The style of the button
97
+ */
98
+ style: Style;
99
+ /**
100
+ * The emoji to display to the left of the text
101
+ */
102
+ emoji?: APIMessageComponentEmoji;
103
+ /**
104
+ * The status of the button
105
+ */
106
+ disabled?: boolean;
107
+ }
108
+ export interface APIMessageComponentEmoji {
109
+ /**
110
+ * Emoji id
111
+ */
112
+ id?: Snowflake;
113
+ /**
114
+ * Emoji name
115
+ */
116
+ name?: string;
117
+ /**
118
+ * Whether this emoji is animated
119
+ */
120
+ animated?: boolean;
121
+ }
122
+ export interface APIButtonComponentWithCustomId extends APIButtonComponentBase<ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success> {
123
+ /**
124
+ * The custom_id to be sent in the interaction when clicked
125
+ */
126
+ custom_id: string;
127
+ }
128
+ export interface APIButtonComponentWithURL extends APIButtonComponentBase<ButtonStyle.Link> {
129
+ /**
130
+ * The URL to direct users to when clicked for Link buttons
131
+ */
132
+ url: string;
133
+ }
134
+ export interface APIButtonComponentWithSKUId extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
135
+ /**
136
+ * The id for a purchasable SKU
137
+ */
138
+ sku_id: Snowflake;
139
+ }
140
+ export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithSKUId | APIButtonComponentWithURL;
141
+ /**
142
+ * https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
143
+ */
144
+ export declare enum ButtonStyle {
145
+ Primary = 1,
146
+ Secondary = 2,
147
+ Success = 3,
148
+ Danger = 4,
149
+ Link = 5,
150
+ Premium = 6
151
+ }
152
+ /**
153
+ * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles
154
+ */
155
+ export declare enum TextInputStyle {
156
+ Short = 1,
157
+ Paragraph = 2
158
+ }
159
+ /**
160
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
161
+ */
162
+ export interface APIBaseSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect> extends APIBaseComponent<T> {
163
+ /**
164
+ * A developer-defined identifier for the select menu, max 100 characters
165
+ */
166
+ custom_id: string;
167
+ /**
168
+ * Custom placeholder text if nothing is selected, max 150 characters
169
+ */
170
+ placeholder?: string;
171
+ /**
172
+ * The minimum number of items that must be chosen; min 0, max 25
173
+ *
174
+ * @default 1
175
+ */
176
+ min_values?: number;
177
+ /**
178
+ * The maximum number of items that can be chosen; max 25
179
+ *
180
+ * @default 1
181
+ */
182
+ max_values?: number;
183
+ /**
184
+ * Disable the select
185
+ *
186
+ * @default false
187
+ */
188
+ disabled?: boolean;
189
+ }
190
+ export interface APIBaseAutoPopulatedSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.UserSelect, D extends SelectMenuDefaultValueType> extends APIBaseSelectMenuComponent<T> {
191
+ /**
192
+ * List of default values for auto-populated select menu components
193
+ */
194
+ default_values?: APISelectMenuDefaultValue<D>[];
195
+ }
196
+ /**
197
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
198
+ */
199
+ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
200
+ /**
201
+ * Specified choices in a select menu; max 25
202
+ */
203
+ options: APISelectMenuOption[];
204
+ }
205
+ /**
206
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
207
+ */
208
+ export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.UserSelect, SelectMenuDefaultValueType.User>;
209
+ /**
210
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
211
+ */
212
+ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.RoleSelect, SelectMenuDefaultValueType.Role>;
213
+ /**
214
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
215
+ */
216
+ export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.MentionableSelect, SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User>;
217
+ /**
218
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
219
+ */
220
+ export interface APIChannelSelectComponent extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
221
+ /**
222
+ * List of channel types to include in the ChannelSelect component
223
+ */
224
+ channel_types?: ChannelType[];
225
+ }
226
+ /**
227
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
228
+ */
229
+ export declare enum SelectMenuDefaultValueType {
230
+ Channel = "channel",
231
+ Role = "role",
232
+ User = "user"
233
+ }
234
+ /**
235
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
236
+ */
237
+ export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
238
+ type: T;
239
+ id: Snowflake;
240
+ }
241
+ export type APIAutoPopulatedSelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIUserSelectComponent;
242
+ /**
243
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
244
+ */
245
+ export type APISelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIStringSelectComponent | APIUserSelectComponent;
246
+ /**
247
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
248
+ */
249
+ export interface APISelectMenuOption {
250
+ /**
251
+ * The user-facing name of the option (max 100 chars)
252
+ */
253
+ label: string;
254
+ /**
255
+ * The dev-defined value of the option (max 100 chars)
256
+ */
257
+ value: string;
258
+ /**
259
+ * An additional description of the option (max 100 chars)
260
+ */
261
+ description?: string;
262
+ /**
263
+ * The emoji to display to the left of the option
264
+ */
265
+ emoji?: APIMessageComponentEmoji;
266
+ /**
267
+ * Whether this option should be already-selected by default
268
+ */
269
+ default?: boolean;
270
+ }
271
+ /**
272
+ * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure
273
+ */
274
+ export interface APITextInputComponent extends APIBaseComponent<ComponentType.TextInput> {
275
+ /**
276
+ * One of text input styles
277
+ */
278
+ style: TextInputStyle;
279
+ /**
280
+ * The custom id for the text input
281
+ */
282
+ custom_id: string;
283
+ /**
284
+ * Text that appears on top of the text input field, max 45 characters
285
+ */
286
+ label: string;
287
+ /**
288
+ * Placeholder for the text input
289
+ */
290
+ placeholder?: string;
291
+ /**
292
+ * The pre-filled text in the text input
293
+ */
294
+ value?: string;
295
+ /**
296
+ * Minimal length of text input
297
+ */
298
+ min_length?: number;
299
+ /**
300
+ * Maximal length of text input
301
+ */
302
+ max_length?: number;
303
+ /**
304
+ * Whether or not this text input is required or not
305
+ */
306
+ required?: boolean;
307
+ }
308
+ /**
309
+ * https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
310
+ */
311
+ export declare enum ChannelFlags {
312
+ /**
313
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
314
+ */
315
+ GuildFeedRemoved = 1,
316
+ /**
317
+ * This thread is pinned to the top of its parent forum channel
318
+ */
319
+ Pinned = 2,
320
+ /**
321
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
322
+ */
323
+ ActiveChannelsRemoved = 4,
324
+ /**
325
+ * Whether a tag is required to be specified when creating a thread in a forum channel.
326
+ * Tags are specified in the `applied_tags` field
327
+ */
328
+ RequireTag = 16,
329
+ /**
330
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
331
+ */
332
+ IsSpam = 32,
333
+ /**
334
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
335
+ */
336
+ IsGuildResourceChannel = 128,
337
+ /**
338
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
339
+ */
340
+ ClydeAI = 256,
341
+ /**
342
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
343
+ */
344
+ IsScheduledForDeletion = 512,
345
+ /**
346
+ * Whether media download options are hidden.
347
+ */
348
+ HideMediaDownloadOptions = 32768
349
+ }
350
+ /**
351
+ * https://discord.com/developers/docs/interactions/message-components#message-components
352
+ */
353
+ export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
354
+ export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
355
+ export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;
356
+ /**
357
+ * https://discord.com/developers/docs/interactions/message-components#message-components
358
+ */
359
+ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent;
360
+ export type APIComponents = APIMessageActionRowComponent | APIModalActionRowComponent | APIContainerComponent | APIContainerComponents | APITopLevelComponent;
361
+ export type APIModalActionRowComponent = APITextInputComponent;
362
+ /**
363
+ * https://discord.com/developers/docs/components/reference#section
364
+ *
365
+ * A Section is a top-level layout component that allows you to join text contextually with an accessory.
366
+ */
367
+ export interface APISectionComponent {
368
+ /** 9 for section component */
369
+ type: ComponentType.Section;
370
+ /** Optional identifier for component */
371
+ id?: number;
372
+ /** One to three text components */
373
+ components: APITextDispalyComponent[];
374
+ /** A thumbnail or a button component, with a future possibility of adding more compatible components */
375
+ accessory: APIButtonComponent | APIThumbnailComponent;
376
+ }
377
+ /**
378
+ * https://discord.com/developers/docs/components/reference#text-display
379
+ *
380
+ * A Text Display is a top-level content component that allows you to add text to your message formatted with markdown and mention users and roles. This is similar to the content field of a message, but allows you to add multiple text components, controlling the layout of your message.
381
+ * Text Displays are only available in messages.
382
+ */
383
+ export interface APITextDispalyComponent {
384
+ /** 10 for text display */
385
+ type: ComponentType.TextDisplay;
386
+ /** Optional identifier for component */
387
+ id?: number;
388
+ /** Text that will be displayed similar to a message */
389
+ content: string;
390
+ }
391
+ /**
392
+ * https://discord.com/developers/docs/components/reference#thumbnail
393
+ *
394
+ * A Thumbnail is a content component that is a small image only usable as an accessory in a section. The preview comes from an url or attachment through the unfurled media item structure.
395
+ * Thumbnails are only available in messages as an accessory in a section.
396
+ */
397
+ export interface APIThumbnailComponent {
398
+ /** 11 for thumbnail */
399
+ type: ComponentType.Thumbnail;
400
+ /** Optional identifier for component */
401
+ id?: number;
402
+ /** A url or attachment */
403
+ media: APIUnfurledMediaItem;
404
+ /** Alt text for the media */
405
+ description?: string;
406
+ /** Whether the thumbnail should be a spoiler (or blurred out). Defaults to false */
407
+ spoiler?: boolean;
408
+ }
409
+ /**
410
+ * https://discord.com/developers/docs/components/reference#media-gallery
411
+ *
412
+ * A Media Gallery is a top-level content component that allows you to display 1-10 media attachments in an organized gallery format. Each item can have optional descriptions and can be marked as spoilers.
413
+ * Media Galleries are only available in messages.
414
+ */
415
+ export interface APIMediaGalleryComponent {
416
+ /** 12 for media gallery */
417
+ type: ComponentType.MediaGallery;
418
+ /** Optional identifier for component */
419
+ id?: number;
420
+ /** 1 to 10 media gallery items */
421
+ items: APIMediaGalleryItems[];
422
+ }
423
+ export interface APIMediaGalleryItems {
424
+ /** A url or attachment */
425
+ media: APIUnfurledMediaItem;
426
+ /** Alt text for the media */
427
+ description?: string;
428
+ /** Whether the thumbnail should be a spoiler (or blurred out). Defaults to false */
429
+ spoiler?: boolean;
430
+ }
431
+ /**
432
+ * https://discord.com/developers/docs/components/reference#file
433
+ *
434
+ * A File is a top-level component that allows you to display an uploaded file as an attachment to the message and reference it in the component. Each file component can only display 1 attached file, but you can upload multiple files and add them to different file components within your payload. This is similar to the embeds field of a message but allows you to control the layout of your message by using this anywhere as a component.
435
+ * Files are only available in messages.
436
+ */
437
+ export interface APIFileComponent {
438
+ /** 13 for file */
439
+ type: ComponentType.File;
440
+ /** Optional identifier for component */
441
+ id?: number;
442
+ /** This unfurled media item is unique in that it only supports attachment references using the attachment://<filename> syntax */
443
+ file: APIUnfurledMediaItem;
444
+ /** Whether the media should be a spoiler (or blurred out). Defaults to false */
445
+ spoiler?: boolean;
446
+ }
447
+ /**
448
+ * https://discord.com/developers/docs/components/reference#separator
449
+ *
450
+ * A Separator is a top-level layout component that adds vertical padding and visual division between other components.
451
+ */
452
+ export interface APISeparatorComponent {
453
+ /** 14 for separator */
454
+ type: ComponentType.Separator;
455
+ /** Optional identifier for component */
456
+ id?: number;
457
+ /** Whether a visual divider should be displayed in the component. Defaults to true */
458
+ divider?: boolean;
459
+ /** Size of separator padding—1 for small padding, 2 for large padding. Defaults to 1 */
460
+ spacing?: Spacing;
461
+ }
462
+ export declare enum Spacing {
463
+ /** For small padding */
464
+ Small = 1,
465
+ /** For large padding */
466
+ Large = 2
467
+ }
468
+ export type APIContainerComponents = APIActionRowComponent<APIActionRowComponentTypes> | APITextDispalyComponent | APISectionComponent | APIMediaGalleryComponent | APIFileComponent | APISeparatorComponent | APIThumbnailComponent;
469
+ /**
470
+ * https://discord.com/developers/docs/components/reference#container
471
+ */
472
+ export interface APIContainerComponent {
473
+ /** 15 for container */
474
+ type: ComponentType.Container;
475
+ /** Optional identifier for component */
476
+ id?: number;
477
+ /** Up to 10 components of the type action row, text display, section, media gallery, separator, or file */
478
+ components: APIContainerComponents[];
479
+ /** Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF */
480
+ accent_color?: number;
481
+ /** Whether the container should be a spoiler (or blurred out). Defaults to false. */
482
+ spoiler?: boolean;
483
+ }
484
+ /**
485
+ * https://discord.com/developers/docs/components/reference#unfurled-media-item-structure
486
+ */
487
+ export interface APIUnfurledMediaItem extends Identify<MakeRequired<Partial<Pick<APIAttachment, 'url' | 'proxy_url' | 'height' | 'width' | 'content_type'>>, 'url'>> {
488
+ }
489
+ export type APITopLevelComponent = APIContainerComponent | APIActionRowComponent<APIActionRowComponentTypes> | APIFileComponent | APIMediaGalleryComponent | APISectionComponent | APISeparatorComponent | APITextDispalyComponent;