disgroove 2.2.7-dev.fca4921 → 2.2.7
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/dist/lib/Client.d.ts +49 -13
- package/dist/lib/Client.js +99 -6
- package/dist/lib/constants.d.ts +29 -21
- package/dist/lib/constants.js +33 -24
- package/dist/lib/gateway/Shard.js +15 -0
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/rest/Endpoints.d.ts +4 -0
- package/dist/lib/rest/Endpoints.js +10 -1
- package/dist/lib/rest/RequestManager.d.ts +1 -3
- package/dist/lib/transformers/Components.d.ts +13 -3
- package/dist/lib/transformers/Components.js +277 -150
- package/dist/lib/transformers/Interactions.js +283 -38
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +20 -34
- package/dist/lib/transformers/Roles.js +2 -2
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/components.d.ts +450 -0
- package/dist/lib/types/components.js +2 -0
- package/dist/lib/types/gateway-events.d.ts +23 -1
- package/dist/lib/types/guild.d.ts +7 -5
- package/dist/lib/types/interaction.d.ts +12 -8
- package/dist/lib/types/invite.d.ts +2 -2
- package/dist/lib/types/lobby.d.ts +29 -0
- package/dist/lib/types/lobby.js +2 -0
- package/dist/lib/types/message-components.d.ts +334 -118
- package/dist/lib/types/message.d.ts +3 -5
- package/dist/lib/types/role.d.ts +2 -2
- package/dist/lib/utils/formatters.d.ts +1 -1
- package/dist/lib/utils/formatters.js +1 -1
- package/dist/package.json +4 -4
- package/package.json +4 -4
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import type { ButtonStyles, ChannelTypes, ComponentTypes, SeparatorSpacing, TextInputStyles } from "../constants";
|
|
2
|
+
import type { snowflake } from "./common";
|
|
3
|
+
import type { RawEmoji, Emoji } from "./emoji";
|
|
4
|
+
import type { RawResolvedData, ResolvedData } from "./interaction";
|
|
5
|
+
/** https://discord.com/developers/docs/components/reference#action-row-action-row-structure */
|
|
6
|
+
export interface RawActionRow {
|
|
7
|
+
type: ComponentTypes.ActionRow;
|
|
8
|
+
components: Array<RawButton | RawStringSelect | RawTextInput | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
|
|
9
|
+
id?: number;
|
|
10
|
+
}
|
|
11
|
+
/** https://discord.com/developers/docs/components/reference#button-button-structure */
|
|
12
|
+
export interface RawButton {
|
|
13
|
+
type: ComponentTypes.Button;
|
|
14
|
+
id?: number;
|
|
15
|
+
style: ButtonStyles;
|
|
16
|
+
label?: string;
|
|
17
|
+
emoji?: Pick<RawEmoji, "name" | "id" | "animated">;
|
|
18
|
+
custom_id: string;
|
|
19
|
+
sku_id?: snowflake;
|
|
20
|
+
url?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** https://discord.com/developers/docs/components/reference#string-select-string-select-structure */
|
|
24
|
+
export interface RawStringSelect {
|
|
25
|
+
type: ComponentTypes.StringSelect;
|
|
26
|
+
id?: number;
|
|
27
|
+
custom_id: string;
|
|
28
|
+
options: Array<RawSelectOption>;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
min_values?: number;
|
|
31
|
+
max_values?: number;
|
|
32
|
+
required?: boolean;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** https://discord.com/developers/docs/components/reference#string-select-string-select-interaction-response-structure */
|
|
36
|
+
export interface RawStringSelectInteractionResponse {
|
|
37
|
+
type: ComponentTypes.StringSelect;
|
|
38
|
+
component_type: ComponentTypes.StringSelect;
|
|
39
|
+
id: number;
|
|
40
|
+
custom_id: string;
|
|
41
|
+
values: Array<string>;
|
|
42
|
+
}
|
|
43
|
+
/** https://discord.com/developers/docs/components/reference#string-select-select-option-structure */
|
|
44
|
+
export interface RawSelectOption {
|
|
45
|
+
label: string;
|
|
46
|
+
value: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
emoji?: Pick<RawEmoji, "name" | "id" | "animated">;
|
|
49
|
+
default?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-structure */
|
|
52
|
+
export interface RawTextInput {
|
|
53
|
+
type: ComponentTypes.TextInput;
|
|
54
|
+
id?: number;
|
|
55
|
+
custom_id: string;
|
|
56
|
+
style: TextInputStyles;
|
|
57
|
+
min_length?: number;
|
|
58
|
+
max_length?: number;
|
|
59
|
+
required?: boolean;
|
|
60
|
+
value?: string;
|
|
61
|
+
placeholder?: string;
|
|
62
|
+
label: string;
|
|
63
|
+
}
|
|
64
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-interaction-response-structure */
|
|
65
|
+
export interface RawTextInputInteractionResponse {
|
|
66
|
+
type: ComponentTypes.TextInput;
|
|
67
|
+
id: number;
|
|
68
|
+
custom_id: string;
|
|
69
|
+
value: string;
|
|
70
|
+
}
|
|
71
|
+
/** https://discord.com/developers/docs/components/reference#user-select-user-select-structure */
|
|
72
|
+
export interface RawUserSelect {
|
|
73
|
+
type: ComponentTypes.UserSelect;
|
|
74
|
+
id?: number;
|
|
75
|
+
custom_id: string;
|
|
76
|
+
placeholder?: string;
|
|
77
|
+
default_values?: Array<RawDefaultValue>;
|
|
78
|
+
min_values?: number;
|
|
79
|
+
max_values?: number;
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/** https://discord.com/developers/docs/components/reference#user-select-user-select-interaction-response-structure */
|
|
83
|
+
export interface RawUserSelectInteractionResponse {
|
|
84
|
+
type: ComponentTypes.UserSelect;
|
|
85
|
+
component_type: ComponentTypes.UserSelect;
|
|
86
|
+
id: number;
|
|
87
|
+
custom_id: string;
|
|
88
|
+
resolved: RawResolvedData;
|
|
89
|
+
values: Array<snowflake>;
|
|
90
|
+
}
|
|
91
|
+
/** https://discord.com/developers/docs/components/reference#user-select-select-default-value-structure */
|
|
92
|
+
export interface RawDefaultValue {
|
|
93
|
+
id: snowflake;
|
|
94
|
+
type: "user" | "role" | "channel";
|
|
95
|
+
}
|
|
96
|
+
/** https://discord.com/developers/docs/components/reference#role-select-role-select-structure */
|
|
97
|
+
export interface RawRoleSelect {
|
|
98
|
+
type: ComponentTypes.RoleSelect;
|
|
99
|
+
id?: number;
|
|
100
|
+
custom_id: string;
|
|
101
|
+
placeholder?: string;
|
|
102
|
+
default_values?: Array<RawDefaultValue>;
|
|
103
|
+
min_values?: number;
|
|
104
|
+
max_values?: number;
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/** https://discord.com/developers/docs/components/reference#role-select-role-select-interaction-response-structure */
|
|
108
|
+
export interface RawRoleSelectInteractionResponse {
|
|
109
|
+
type: ComponentTypes.RoleSelect;
|
|
110
|
+
component_type: ComponentTypes.RoleSelect;
|
|
111
|
+
id: number;
|
|
112
|
+
custom_id: string;
|
|
113
|
+
resolved: RawResolvedData;
|
|
114
|
+
values: Array<snowflake>;
|
|
115
|
+
}
|
|
116
|
+
/** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-structure */
|
|
117
|
+
export interface RawMentionableSelect {
|
|
118
|
+
type: ComponentTypes.MentionableSelect;
|
|
119
|
+
id?: number;
|
|
120
|
+
custom_id: string;
|
|
121
|
+
placeholder?: string;
|
|
122
|
+
default_values?: Array<RawDefaultValue>;
|
|
123
|
+
min_values?: number;
|
|
124
|
+
max_values?: number;
|
|
125
|
+
disabled?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-interaction-response-structure */
|
|
128
|
+
export interface RawMentionableSelectInteractionResponse {
|
|
129
|
+
type: ComponentTypes.MentionableSelect;
|
|
130
|
+
component_type: ComponentTypes.MentionableSelect;
|
|
131
|
+
id: number;
|
|
132
|
+
custom_id: string;
|
|
133
|
+
resolved: RawResolvedData;
|
|
134
|
+
values: Array<snowflake>;
|
|
135
|
+
}
|
|
136
|
+
/** https://discord.com/developers/docs/components/reference#channel-select-channel-select-structure */
|
|
137
|
+
export interface RawChannelSelect {
|
|
138
|
+
type: ComponentTypes.ChannelSelect;
|
|
139
|
+
id?: number;
|
|
140
|
+
custom_id: string;
|
|
141
|
+
channel_types?: Array<ChannelTypes>;
|
|
142
|
+
placeholder?: string;
|
|
143
|
+
default_values?: Array<RawDefaultValue>;
|
|
144
|
+
min_values?: number;
|
|
145
|
+
max_values?: number;
|
|
146
|
+
disabled?: boolean;
|
|
147
|
+
}
|
|
148
|
+
/** https://discord.com/developers/docs/components/reference#channel-select-channel-select-interaction-response-structure */
|
|
149
|
+
export interface RawChannelSelectInteractionResponse {
|
|
150
|
+
type: ComponentTypes.ChannelSelect;
|
|
151
|
+
component_type: ComponentTypes.ChannelSelect;
|
|
152
|
+
id: number;
|
|
153
|
+
custom_id: string;
|
|
154
|
+
resolved: RawResolvedData;
|
|
155
|
+
values: Array<snowflake>;
|
|
156
|
+
}
|
|
157
|
+
/** https://discord.com/developers/docs/components/reference#section-section-structure */
|
|
158
|
+
export interface RawSection {
|
|
159
|
+
type: ComponentTypes.Section;
|
|
160
|
+
id?: number;
|
|
161
|
+
components: Array<RawTextDisplay>;
|
|
162
|
+
accessory: RawButton | RawThumbnail;
|
|
163
|
+
}
|
|
164
|
+
/** https://discord.com/developers/docs/components/reference#text-display-text-display-structure */
|
|
165
|
+
export interface RawTextDisplay {
|
|
166
|
+
type: ComponentTypes.TextDisplay;
|
|
167
|
+
id?: number;
|
|
168
|
+
content: string;
|
|
169
|
+
}
|
|
170
|
+
/** https://discord.com/developers/docs/components/reference#text-display-text-display-interaction-response-structure */
|
|
171
|
+
export interface RawTextDisplayInteractionResponse {
|
|
172
|
+
type: ComponentTypes.TextDisplay;
|
|
173
|
+
id: number;
|
|
174
|
+
}
|
|
175
|
+
/** https://discord.com/developers/docs/components/reference#thumbnail-thumbnail-structure */
|
|
176
|
+
export interface RawThumbnail {
|
|
177
|
+
type: ComponentTypes.Thumbnail;
|
|
178
|
+
id?: number;
|
|
179
|
+
media: RawUnfurledMediaItem;
|
|
180
|
+
description?: string;
|
|
181
|
+
spoiler?: boolean;
|
|
182
|
+
}
|
|
183
|
+
/** https://discord.com/developers/docs/components/reference#media-gallery-media-gallery-structure */
|
|
184
|
+
export interface RawMediaGallery {
|
|
185
|
+
type: ComponentTypes.MediaGallery;
|
|
186
|
+
id?: number;
|
|
187
|
+
items: Array<RawMediaGalleryItem>;
|
|
188
|
+
}
|
|
189
|
+
/** https://discord.com/developers/docs/components/reference#media-gallery-media-gallery-item-structure */
|
|
190
|
+
export interface RawMediaGalleryItem {
|
|
191
|
+
media: RawUnfurledMediaItem;
|
|
192
|
+
description?: string;
|
|
193
|
+
spoiler?: boolean;
|
|
194
|
+
}
|
|
195
|
+
/** https://discord.com/developers/docs/components/reference#file-file-structure */
|
|
196
|
+
export interface RawFile {
|
|
197
|
+
type: ComponentTypes.File;
|
|
198
|
+
id?: number;
|
|
199
|
+
file: RawUnfurledMediaItem;
|
|
200
|
+
spoiler?: boolean;
|
|
201
|
+
name: string;
|
|
202
|
+
size: number;
|
|
203
|
+
}
|
|
204
|
+
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
|
205
|
+
export interface RawSeparator {
|
|
206
|
+
type: ComponentTypes.Separator;
|
|
207
|
+
id?: number;
|
|
208
|
+
divider?: boolean;
|
|
209
|
+
spacing?: SeparatorSpacing;
|
|
210
|
+
}
|
|
211
|
+
/** https://discord.com/developers/docs/components/reference#container-container-structure */
|
|
212
|
+
export interface RawContainer {
|
|
213
|
+
type: ComponentTypes.Container;
|
|
214
|
+
id?: number;
|
|
215
|
+
components: Array<RawActionRow | RawTextDisplay | RawSection | RawMediaGallery | RawSeparator | RawFile>;
|
|
216
|
+
accent_color?: number | null;
|
|
217
|
+
spoiler?: boolean;
|
|
218
|
+
}
|
|
219
|
+
/** https://discord.com/developers/docs/components/reference#label-label-structure */
|
|
220
|
+
export interface RawLabel {
|
|
221
|
+
type: ComponentTypes.Label;
|
|
222
|
+
id?: number;
|
|
223
|
+
label: string;
|
|
224
|
+
description?: string;
|
|
225
|
+
component: RawTextInput | RawStringSelect | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect;
|
|
226
|
+
}
|
|
227
|
+
/** https://discord.com/developers/docs/components/reference#label-label-interaction-response-structure */
|
|
228
|
+
export interface RawLabelInteractionResponse {
|
|
229
|
+
type: ComponentTypes.Label;
|
|
230
|
+
id: number;
|
|
231
|
+
component: RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse;
|
|
232
|
+
}
|
|
233
|
+
/** https://discord.com/developers/docs/components/reference#unfurled-media-item-unfurled-media-item-structure */
|
|
234
|
+
export interface RawUnfurledMediaItem {
|
|
235
|
+
url: string;
|
|
236
|
+
proxy_url?: string;
|
|
237
|
+
height?: number | null;
|
|
238
|
+
width?: number | null;
|
|
239
|
+
content_type?: string;
|
|
240
|
+
attachment_id?: snowflake;
|
|
241
|
+
}
|
|
242
|
+
export interface ActionRow {
|
|
243
|
+
type: ComponentTypes.ActionRow;
|
|
244
|
+
components: Array<Button | StringSelect | TextInput | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
|
|
245
|
+
id?: number;
|
|
246
|
+
}
|
|
247
|
+
export interface Button {
|
|
248
|
+
type: ComponentTypes.Button;
|
|
249
|
+
id?: number;
|
|
250
|
+
style: ButtonStyles;
|
|
251
|
+
label?: string;
|
|
252
|
+
emoji?: Pick<Emoji, "name" | "id" | "animated">;
|
|
253
|
+
customID: string;
|
|
254
|
+
skuID?: snowflake;
|
|
255
|
+
url?: string;
|
|
256
|
+
disabled?: boolean;
|
|
257
|
+
}
|
|
258
|
+
export interface StringSelect {
|
|
259
|
+
type: ComponentTypes.StringSelect;
|
|
260
|
+
id?: number;
|
|
261
|
+
customID: string;
|
|
262
|
+
options: Array<SelectOption>;
|
|
263
|
+
placeholder?: string;
|
|
264
|
+
minValues?: number;
|
|
265
|
+
maxValues?: number;
|
|
266
|
+
required?: boolean;
|
|
267
|
+
disabled?: boolean;
|
|
268
|
+
}
|
|
269
|
+
export interface StringSelectInteractionResponse {
|
|
270
|
+
type: ComponentTypes.StringSelect;
|
|
271
|
+
componentType: ComponentTypes.StringSelect;
|
|
272
|
+
id: number;
|
|
273
|
+
customID: string;
|
|
274
|
+
values: Array<string>;
|
|
275
|
+
}
|
|
276
|
+
export interface SelectOption {
|
|
277
|
+
label: string;
|
|
278
|
+
value: string;
|
|
279
|
+
description?: string;
|
|
280
|
+
emoji?: Pick<Emoji, "name" | "id" | "animated">;
|
|
281
|
+
default?: boolean;
|
|
282
|
+
}
|
|
283
|
+
export interface TextInput {
|
|
284
|
+
type: ComponentTypes.TextInput;
|
|
285
|
+
id?: number;
|
|
286
|
+
customID: string;
|
|
287
|
+
style: TextInputStyles;
|
|
288
|
+
minLength?: number;
|
|
289
|
+
maxLength?: number;
|
|
290
|
+
required?: boolean;
|
|
291
|
+
value?: string;
|
|
292
|
+
placeholder?: string;
|
|
293
|
+
label: string;
|
|
294
|
+
}
|
|
295
|
+
export interface TextInputInteractionResponse {
|
|
296
|
+
type: ComponentTypes.TextInput;
|
|
297
|
+
id: number;
|
|
298
|
+
customID: string;
|
|
299
|
+
value: string;
|
|
300
|
+
}
|
|
301
|
+
export interface UserSelect {
|
|
302
|
+
type: ComponentTypes.UserSelect;
|
|
303
|
+
id?: number;
|
|
304
|
+
customID: string;
|
|
305
|
+
placeholder?: string;
|
|
306
|
+
defaultValues?: Array<DefaultValue>;
|
|
307
|
+
minValues?: number;
|
|
308
|
+
maxValues?: number;
|
|
309
|
+
disabled?: boolean;
|
|
310
|
+
}
|
|
311
|
+
export interface UserSelectInteractionResponse {
|
|
312
|
+
type: ComponentTypes.UserSelect;
|
|
313
|
+
componentType: ComponentTypes.UserSelect;
|
|
314
|
+
id: number;
|
|
315
|
+
customID: string;
|
|
316
|
+
resolved: ResolvedData;
|
|
317
|
+
values: Array<snowflake>;
|
|
318
|
+
}
|
|
319
|
+
export interface DefaultValue {
|
|
320
|
+
id: snowflake;
|
|
321
|
+
type: "user" | "role" | "channel";
|
|
322
|
+
}
|
|
323
|
+
export interface RoleSelect {
|
|
324
|
+
type: ComponentTypes.RoleSelect;
|
|
325
|
+
id?: number;
|
|
326
|
+
customID: string;
|
|
327
|
+
placeholder?: string;
|
|
328
|
+
defaultValues?: Array<DefaultValue>;
|
|
329
|
+
minValues?: number;
|
|
330
|
+
maxValues?: number;
|
|
331
|
+
disabled?: boolean;
|
|
332
|
+
}
|
|
333
|
+
export interface RoleSelectInteractionResponse {
|
|
334
|
+
type: ComponentTypes.RoleSelect;
|
|
335
|
+
componentType: ComponentTypes.RoleSelect;
|
|
336
|
+
id: number;
|
|
337
|
+
customID: string;
|
|
338
|
+
resolved: ResolvedData;
|
|
339
|
+
values: Array<snowflake>;
|
|
340
|
+
}
|
|
341
|
+
export interface MentionableSelect {
|
|
342
|
+
type: ComponentTypes.MentionableSelect;
|
|
343
|
+
id?: number;
|
|
344
|
+
customID: string;
|
|
345
|
+
placeholder?: string;
|
|
346
|
+
defaultValues?: Array<DefaultValue>;
|
|
347
|
+
minValues?: number;
|
|
348
|
+
maxValues?: number;
|
|
349
|
+
disabled?: boolean;
|
|
350
|
+
}
|
|
351
|
+
export interface MentionableSelectInteractionResponse {
|
|
352
|
+
type: ComponentTypes.MentionableSelect;
|
|
353
|
+
componentType: ComponentTypes.MentionableSelect;
|
|
354
|
+
id: number;
|
|
355
|
+
customID: string;
|
|
356
|
+
resolved: ResolvedData;
|
|
357
|
+
values: Array<snowflake>;
|
|
358
|
+
}
|
|
359
|
+
export interface ChannelSelect {
|
|
360
|
+
type: ComponentTypes.ChannelSelect;
|
|
361
|
+
id?: number;
|
|
362
|
+
customID: string;
|
|
363
|
+
channelTypes?: Array<ChannelTypes>;
|
|
364
|
+
placeholder?: string;
|
|
365
|
+
defaultValues?: Array<DefaultValue>;
|
|
366
|
+
minValues?: number;
|
|
367
|
+
maxValues?: number;
|
|
368
|
+
disabled?: boolean;
|
|
369
|
+
}
|
|
370
|
+
export interface ChannelSelectInteractionResponse {
|
|
371
|
+
type: ComponentTypes.ChannelSelect;
|
|
372
|
+
componentType: ComponentTypes.ChannelSelect;
|
|
373
|
+
id: number;
|
|
374
|
+
customID: string;
|
|
375
|
+
resolved: ResolvedData;
|
|
376
|
+
values: Array<snowflake>;
|
|
377
|
+
}
|
|
378
|
+
export interface Section {
|
|
379
|
+
type: ComponentTypes.Section;
|
|
380
|
+
id?: number;
|
|
381
|
+
components: Array<TextDisplay>;
|
|
382
|
+
accessory: Button | Thumbnail;
|
|
383
|
+
}
|
|
384
|
+
export interface TextDisplay {
|
|
385
|
+
type: ComponentTypes.TextDisplay;
|
|
386
|
+
id?: number;
|
|
387
|
+
content: string;
|
|
388
|
+
}
|
|
389
|
+
export interface TextDisplayInteractionResponse {
|
|
390
|
+
type: ComponentTypes.TextDisplay;
|
|
391
|
+
id: number;
|
|
392
|
+
}
|
|
393
|
+
export interface Thumbnail {
|
|
394
|
+
type: ComponentTypes.Thumbnail;
|
|
395
|
+
id?: number;
|
|
396
|
+
media: UnfurledMediaItem;
|
|
397
|
+
description?: string;
|
|
398
|
+
spoiler?: boolean;
|
|
399
|
+
}
|
|
400
|
+
export interface MediaGallery {
|
|
401
|
+
type: ComponentTypes.MediaGallery;
|
|
402
|
+
id?: number;
|
|
403
|
+
items: Array<MediaGalleryItem>;
|
|
404
|
+
}
|
|
405
|
+
export interface MediaGalleryItem {
|
|
406
|
+
media: UnfurledMediaItem;
|
|
407
|
+
description?: string;
|
|
408
|
+
spoiler?: boolean;
|
|
409
|
+
}
|
|
410
|
+
export interface File {
|
|
411
|
+
type: ComponentTypes.File;
|
|
412
|
+
id?: number;
|
|
413
|
+
file: UnfurledMediaItem;
|
|
414
|
+
spoiler?: boolean;
|
|
415
|
+
name: string;
|
|
416
|
+
size: number;
|
|
417
|
+
}
|
|
418
|
+
export interface Separator {
|
|
419
|
+
type: ComponentTypes.Separator;
|
|
420
|
+
id?: number;
|
|
421
|
+
divider?: boolean;
|
|
422
|
+
spacing?: SeparatorSpacing;
|
|
423
|
+
}
|
|
424
|
+
export interface Container {
|
|
425
|
+
type: ComponentTypes.Container;
|
|
426
|
+
id?: number;
|
|
427
|
+
components: Array<ActionRow | TextDisplay | Section | MediaGallery | Separator | File>;
|
|
428
|
+
accentColor?: number | null;
|
|
429
|
+
spoiler?: boolean;
|
|
430
|
+
}
|
|
431
|
+
export interface Label {
|
|
432
|
+
type: ComponentTypes.Label;
|
|
433
|
+
id?: number;
|
|
434
|
+
label: string;
|
|
435
|
+
description?: string;
|
|
436
|
+
component: TextInput | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect;
|
|
437
|
+
}
|
|
438
|
+
export interface LabelInteractionResponse {
|
|
439
|
+
type: ComponentTypes.Label;
|
|
440
|
+
id: number;
|
|
441
|
+
component: TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse;
|
|
442
|
+
}
|
|
443
|
+
export interface UnfurledMediaItem {
|
|
444
|
+
url: string;
|
|
445
|
+
proxyURL?: string;
|
|
446
|
+
height?: number | null;
|
|
447
|
+
width?: number | null;
|
|
448
|
+
contentType?: string;
|
|
449
|
+
attachmentID?: snowflake;
|
|
450
|
+
}
|
|
@@ -49,7 +49,7 @@ export interface RawRequestGuildMembers {
|
|
|
49
49
|
nonce?: string;
|
|
50
50
|
}
|
|
51
51
|
/** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds-request-soundboard-sounds-structure */
|
|
52
|
-
export interface
|
|
52
|
+
export interface RawRequestSoundboardSounds {
|
|
53
53
|
guild_ids: Array<snowflake>;
|
|
54
54
|
}
|
|
55
55
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
|
|
@@ -207,6 +207,7 @@ export interface RawInviteCreateEventFields {
|
|
|
207
207
|
target_application?: RawApplication;
|
|
208
208
|
temporary: boolean;
|
|
209
209
|
uses: number;
|
|
210
|
+
expires_at: timestamp | null;
|
|
210
211
|
}
|
|
211
212
|
/** https://discord.com/developers/docs/topics/gateway-events#invite-delete-invite-delete-event-fields */
|
|
212
213
|
export interface RawInviteDeleteEventFields {
|
|
@@ -375,6 +376,17 @@ export interface RawMessagePollVoteRemoveFields {
|
|
|
375
376
|
guild_id?: snowflake;
|
|
376
377
|
answer_id: number;
|
|
377
378
|
}
|
|
379
|
+
/** https://discord.com/developers/docs/events/gateway-events#rate-limited-rate-limited-fields */
|
|
380
|
+
export interface RawRateLimitedFields {
|
|
381
|
+
opcode: GatewayOPCodes;
|
|
382
|
+
retry_after: number;
|
|
383
|
+
meta: RawRequestGuildMembersRateLimitMetadata;
|
|
384
|
+
}
|
|
385
|
+
/** https://discord.com/developers/docs/events/gateway-events#rate-limited-rate-limit-metadata-for-opcode-structure */
|
|
386
|
+
export interface RawRequestGuildMembersRateLimitMetadata {
|
|
387
|
+
guild_id: snowflake;
|
|
388
|
+
nonce?: string;
|
|
389
|
+
}
|
|
378
390
|
export interface Payload {
|
|
379
391
|
op: GatewayOPCodes;
|
|
380
392
|
d: any | null;
|
|
@@ -545,6 +557,7 @@ export interface InviteCreateEventFields {
|
|
|
545
557
|
targetApplication?: Application;
|
|
546
558
|
temporary: boolean;
|
|
547
559
|
uses: number;
|
|
560
|
+
expiresAt: timestamp | null;
|
|
548
561
|
}
|
|
549
562
|
export interface InviteDeleteEventFields {
|
|
550
563
|
channelID: snowflake;
|
|
@@ -691,3 +704,12 @@ export interface MessagePollVoteRemoveFields {
|
|
|
691
704
|
guildID?: snowflake;
|
|
692
705
|
answerID: number;
|
|
693
706
|
}
|
|
707
|
+
export interface RateLimitedFields {
|
|
708
|
+
opcode: GatewayOPCodes;
|
|
709
|
+
retryAfter: number;
|
|
710
|
+
meta: RequestGuildMembersRateLimitMetadata;
|
|
711
|
+
}
|
|
712
|
+
export interface RequestGuildMembersRateLimitMetadata {
|
|
713
|
+
guildID: snowflake;
|
|
714
|
+
nonce?: string;
|
|
715
|
+
}
|
|
@@ -93,13 +93,14 @@ export interface RawGuildMember {
|
|
|
93
93
|
banner?: string | null;
|
|
94
94
|
roles: Array<snowflake>;
|
|
95
95
|
joined_at: timestamp | null;
|
|
96
|
-
premium_since?:
|
|
96
|
+
premium_since?: timestamp | null;
|
|
97
97
|
deaf: boolean;
|
|
98
98
|
mute: boolean;
|
|
99
99
|
flags: GuildMemberFlags;
|
|
100
100
|
pending?: boolean;
|
|
101
101
|
permissions?: string;
|
|
102
|
-
communication_disabled_until?:
|
|
102
|
+
communication_disabled_until?: timestamp | null;
|
|
103
|
+
unusual_dm_activity_until?: timestamp | null;
|
|
103
104
|
avatar_decoration_data?: RawAvatarDecorationData | null;
|
|
104
105
|
}
|
|
105
106
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
|
|
@@ -269,14 +270,15 @@ export interface GuildMember {
|
|
|
269
270
|
avatar?: string | null;
|
|
270
271
|
banner?: string | null;
|
|
271
272
|
roles: Array<snowflake>;
|
|
272
|
-
joinedAt:
|
|
273
|
-
premiumSince?:
|
|
273
|
+
joinedAt: timestamp | null;
|
|
274
|
+
premiumSince?: timestamp | null;
|
|
274
275
|
deaf: boolean;
|
|
275
276
|
mute: boolean;
|
|
276
277
|
flags: GuildMemberFlags;
|
|
277
278
|
pending?: boolean;
|
|
278
279
|
permissions?: string;
|
|
279
|
-
communicationDisabledUntil?:
|
|
280
|
+
communicationDisabledUntil?: timestamp | null;
|
|
281
|
+
unusualDMActivityUntil?: timestamp | null;
|
|
280
282
|
avatarDecorationData?: AvatarDecorationData | null;
|
|
281
283
|
}
|
|
282
284
|
export interface Integration {
|
|
@@ -5,8 +5,8 @@ import type { RawChannel, Channel } from "./channel";
|
|
|
5
5
|
import type { snowflake } from "./common";
|
|
6
6
|
import type { RawEntitlement, Entitlement } from "./entitlements";
|
|
7
7
|
import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
|
|
8
|
-
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions
|
|
9
|
-
import type {
|
|
8
|
+
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
|
|
9
|
+
import type { ActionRow, ChannelSelectInteractionResponse, Container, File, Label, LabelInteractionResponse, MediaGallery, MentionableSelectInteractionResponse, RawActionRow, RawChannelSelectInteractionResponse, RawContainer, RawFile, RawLabel, RawLabelInteractionResponse, RawMediaGallery, RawMentionableSelectInteractionResponse, RawRoleSelectInteractionResponse, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextDisplayInteractionResponse, RawTextInputInteractionResponse, RawUserSelectInteractionResponse, RoleSelectInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextDisplayInteractionResponse, TextInputInteractionResponse, UserSelectInteractionResponse } from "./components";
|
|
10
10
|
import type { RawPollCreateParams, PollCreateParams } from "./poll";
|
|
11
11
|
import type { RawRole, Role } from "./role";
|
|
12
12
|
import type { RawUser, User } from "./user";
|
|
@@ -33,6 +33,7 @@ export interface RawInteraction {
|
|
|
33
33
|
entitlements: Array<RawEntitlement>;
|
|
34
34
|
authorizing_integration_owners: Record<ApplicationIntegrationTypes, string>;
|
|
35
35
|
context?: InteractionContextTypes;
|
|
36
|
+
attachment_size_limit: number;
|
|
36
37
|
}
|
|
37
38
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-data-structure */
|
|
38
39
|
export interface RawApplicationCommandData {
|
|
@@ -56,8 +57,9 @@ export interface RawModalSubmitData {
|
|
|
56
57
|
custom_id: string;
|
|
57
58
|
components: Array<{
|
|
58
59
|
type: ComponentTypes.ActionRow;
|
|
59
|
-
components: Array<
|
|
60
|
-
}>;
|
|
60
|
+
components: Array<RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse>;
|
|
61
|
+
} | RawTextDisplayInteractionResponse | RawLabelInteractionResponse>;
|
|
62
|
+
resolved?: RawResolvedData;
|
|
61
63
|
}
|
|
62
64
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
63
65
|
export interface RawResolvedData {
|
|
@@ -96,7 +98,7 @@ export interface RawInteractionCallbackData {
|
|
|
96
98
|
embeds?: Array<RawEmbed>;
|
|
97
99
|
allowed_mentions?: RawAllowedMentions;
|
|
98
100
|
flags?: MessageFlags;
|
|
99
|
-
components?: Array<
|
|
101
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
100
102
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
101
103
|
poll?: RawPollCreateParams;
|
|
102
104
|
files?: Array<FileData>;
|
|
@@ -150,6 +152,7 @@ export interface Interaction {
|
|
|
150
152
|
entitlements: Array<Entitlement>;
|
|
151
153
|
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
|
152
154
|
context?: InteractionContextTypes;
|
|
155
|
+
attachmentSizeLimit: number;
|
|
153
156
|
}
|
|
154
157
|
export interface ApplicationCommandData {
|
|
155
158
|
id: snowflake;
|
|
@@ -170,8 +173,9 @@ export interface ModalSubmitData {
|
|
|
170
173
|
customID: string;
|
|
171
174
|
components: Array<{
|
|
172
175
|
type: ComponentTypes.ActionRow;
|
|
173
|
-
components: Array<
|
|
174
|
-
}>;
|
|
176
|
+
components: Array<TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse>;
|
|
177
|
+
} | TextDisplayInteractionResponse | LabelInteractionResponse>;
|
|
178
|
+
resolved?: ResolvedData;
|
|
175
179
|
}
|
|
176
180
|
export interface ResolvedData {
|
|
177
181
|
users?: Record<snowflake, User>;
|
|
@@ -205,7 +209,7 @@ export interface InteractionCallbackData {
|
|
|
205
209
|
embeds?: Array<Embed>;
|
|
206
210
|
allowedMentions?: AllowedMentions;
|
|
207
211
|
flags?: MessageFlags;
|
|
208
|
-
components?: Array<
|
|
212
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
209
213
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
210
214
|
poll?: PollCreateParams;
|
|
211
215
|
files?: Array<FileData>;
|
|
@@ -17,7 +17,7 @@ export interface RawInvite {
|
|
|
17
17
|
target_application?: RawApplication;
|
|
18
18
|
approximate_presence_count?: number;
|
|
19
19
|
approximate_member_count?: number;
|
|
20
|
-
expires_at
|
|
20
|
+
expires_at: timestamp | null;
|
|
21
21
|
stage_instance?: RawInviteStageInstance;
|
|
22
22
|
guild_scheduled_event?: RawGuildScheduledEvent;
|
|
23
23
|
flags?: GuildInviteFlags;
|
|
@@ -48,7 +48,7 @@ export interface Invite {
|
|
|
48
48
|
targetApplication?: Application;
|
|
49
49
|
approximatePresenceCount?: number;
|
|
50
50
|
approximateMemberCount?: number;
|
|
51
|
-
expiresAt
|
|
51
|
+
expiresAt: timestamp | null;
|
|
52
52
|
stageInstance?: InviteStageInstance;
|
|
53
53
|
guildScheduledEvent?: GuildScheduledEvent;
|
|
54
54
|
flags?: GuildInviteFlags;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { LobbyMemberFlags } from "../constants";
|
|
2
|
+
import type { RawChannel } from "./channel";
|
|
3
|
+
import type { snowflake } from "./common";
|
|
4
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-object */
|
|
5
|
+
export interface RawLobby {
|
|
6
|
+
id: snowflake;
|
|
7
|
+
application_id: snowflake;
|
|
8
|
+
metadata: Record<string, string> | null;
|
|
9
|
+
members: Array<RawLobbyMember>;
|
|
10
|
+
linked_channel: RawChannel;
|
|
11
|
+
}
|
|
12
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-structure */
|
|
13
|
+
export interface RawLobbyMember {
|
|
14
|
+
id: snowflake;
|
|
15
|
+
metadata?: Record<string, string> | null;
|
|
16
|
+
flags?: LobbyMemberFlags;
|
|
17
|
+
}
|
|
18
|
+
export interface Lobby {
|
|
19
|
+
id: snowflake;
|
|
20
|
+
applicationID: snowflake;
|
|
21
|
+
metadata: Record<string, string> | null;
|
|
22
|
+
members: Array<LobbyMember>;
|
|
23
|
+
linkedChannel: RawChannel;
|
|
24
|
+
}
|
|
25
|
+
export interface LobbyMember {
|
|
26
|
+
id: snowflake;
|
|
27
|
+
metadata?: Record<string, string> | null;
|
|
28
|
+
flags?: LobbyMemberFlags;
|
|
29
|
+
}
|