disgroove 2.2.7-dev.64580a3 → 2.2.7-dev.704bd88
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 +43 -8
- package/dist/lib/Client.js +71 -17
- package/dist/lib/constants.d.ts +5 -0
- package/dist/lib/constants.js +7 -1
- package/dist/lib/gateway/Shard.js +1 -0
- package/dist/lib/rest/Endpoints.d.ts +4 -0
- package/dist/lib/rest/Endpoints.js +10 -1
- package/dist/lib/transformers/Components.d.ts +2 -2
- package/dist/lib/transformers/Components.js +78 -28
- package/dist/lib/transformers/Interactions.js +260 -9
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +3 -3
- package/dist/lib/transformers/Messages.js +0 -28
- 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/gateway-events.d.ts +3 -1
- package/dist/lib/types/guild.d.ts +7 -5
- package/dist/lib/types/interaction.d.ts +15 -5
- 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 +121 -2
- package/dist/lib/types/message.d.ts +3 -3
- 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 +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,6 @@ const Entitlements_1 = require("./Entitlements");
|
|
|
8
8
|
const Roles_1 = require("./Roles");
|
|
9
9
|
const Messages_1 = require("./Messages");
|
|
10
10
|
const constants_1 = require("../constants");
|
|
11
|
-
const Components_1 = require("./Components");
|
|
12
11
|
class Interactions {
|
|
13
12
|
static interactionCallbackResponseFromRaw(interactionCallbackResponse) {
|
|
14
13
|
return {
|
|
@@ -74,11 +73,136 @@ class Interactions {
|
|
|
74
73
|
components: interaction.data?.components?.map((component) => {
|
|
75
74
|
switch (component.type) {
|
|
76
75
|
case constants_1.ComponentTypes.ActionRow:
|
|
77
|
-
return
|
|
76
|
+
return {
|
|
77
|
+
type: constants_1.ComponentTypes.ActionRow,
|
|
78
|
+
components: component.components.map((c) => {
|
|
79
|
+
switch (c.type) {
|
|
80
|
+
case constants_1.ComponentTypes.TextInput:
|
|
81
|
+
return {
|
|
82
|
+
type: c.type,
|
|
83
|
+
id: c.id,
|
|
84
|
+
customID: c.custom_id,
|
|
85
|
+
value: c.value,
|
|
86
|
+
};
|
|
87
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
88
|
+
return {
|
|
89
|
+
type: c.type,
|
|
90
|
+
componentType: c.component_type,
|
|
91
|
+
id: c.id,
|
|
92
|
+
customID: c.custom_id,
|
|
93
|
+
values: c.values,
|
|
94
|
+
};
|
|
95
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
96
|
+
return {
|
|
97
|
+
type: c.type,
|
|
98
|
+
componentType: c.component_type,
|
|
99
|
+
id: c.id,
|
|
100
|
+
customID: c.custom_id,
|
|
101
|
+
resolved: this.resolvedDataFromRaw(c.resolved),
|
|
102
|
+
values: c.values,
|
|
103
|
+
};
|
|
104
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
105
|
+
return {
|
|
106
|
+
type: c.type,
|
|
107
|
+
componentType: c.component_type,
|
|
108
|
+
id: c.id,
|
|
109
|
+
customID: c.custom_id,
|
|
110
|
+
resolved: this.resolvedDataFromRaw(c.resolved),
|
|
111
|
+
values: c.values,
|
|
112
|
+
};
|
|
113
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
114
|
+
return {
|
|
115
|
+
type: c.type,
|
|
116
|
+
componentType: c.component_type,
|
|
117
|
+
id: c.id,
|
|
118
|
+
customID: c.custom_id,
|
|
119
|
+
resolved: this.resolvedDataFromRaw(c.resolved),
|
|
120
|
+
values: c.values,
|
|
121
|
+
};
|
|
122
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
123
|
+
return {
|
|
124
|
+
type: c.type,
|
|
125
|
+
componentType: c.component_type,
|
|
126
|
+
id: c.id,
|
|
127
|
+
customID: c.custom_id,
|
|
128
|
+
resolved: this.resolvedDataFromRaw(c.resolved),
|
|
129
|
+
values: c.values,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}),
|
|
133
|
+
};
|
|
78
134
|
case constants_1.ComponentTypes.TextDisplay:
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
135
|
+
return {
|
|
136
|
+
type: component.type,
|
|
137
|
+
id: component.id,
|
|
138
|
+
};
|
|
139
|
+
case constants_1.ComponentTypes.Label: {
|
|
140
|
+
let c;
|
|
141
|
+
switch (component.component.type) {
|
|
142
|
+
case constants_1.ComponentTypes.TextInput:
|
|
143
|
+
c = {
|
|
144
|
+
type: component.component.type,
|
|
145
|
+
id: component.component.id,
|
|
146
|
+
customID: component.component.custom_id,
|
|
147
|
+
value: component.component.value,
|
|
148
|
+
};
|
|
149
|
+
break;
|
|
150
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
151
|
+
c = {
|
|
152
|
+
type: component.component.type,
|
|
153
|
+
componentType: component.component.component_type,
|
|
154
|
+
id: component.component.id,
|
|
155
|
+
customID: component.component.custom_id,
|
|
156
|
+
values: component.component.values,
|
|
157
|
+
};
|
|
158
|
+
break;
|
|
159
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
160
|
+
c = {
|
|
161
|
+
type: component.component.type,
|
|
162
|
+
componentType: component.component.component_type,
|
|
163
|
+
id: component.component.id,
|
|
164
|
+
customID: component.component.custom_id,
|
|
165
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
166
|
+
values: component.component.values,
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
169
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
170
|
+
c = {
|
|
171
|
+
type: component.component.type,
|
|
172
|
+
componentType: component.component.component_type,
|
|
173
|
+
id: component.component.id,
|
|
174
|
+
customID: component.component.custom_id,
|
|
175
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
176
|
+
values: component.component.values,
|
|
177
|
+
};
|
|
178
|
+
break;
|
|
179
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
180
|
+
c = {
|
|
181
|
+
type: component.component.type,
|
|
182
|
+
componentType: component.component.component_type,
|
|
183
|
+
id: component.component.id,
|
|
184
|
+
customID: component.component.custom_id,
|
|
185
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
186
|
+
values: component.component.values,
|
|
187
|
+
};
|
|
188
|
+
break;
|
|
189
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
190
|
+
c = {
|
|
191
|
+
type: component.component.type,
|
|
192
|
+
componentType: component.component.component_type,
|
|
193
|
+
id: component.component.id,
|
|
194
|
+
customID: component.component.custom_id,
|
|
195
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
196
|
+
values: component.component.values,
|
|
197
|
+
};
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
type: component.type,
|
|
202
|
+
id: component.id,
|
|
203
|
+
component: c,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
82
206
|
}
|
|
83
207
|
}),
|
|
84
208
|
}
|
|
@@ -115,6 +239,7 @@ class Interactions {
|
|
|
115
239
|
"1": interaction.authorizing_integration_owners[1],
|
|
116
240
|
},
|
|
117
241
|
context: interaction.context,
|
|
242
|
+
attachmentSizeLimit: interaction.attachment_size_limit,
|
|
118
243
|
};
|
|
119
244
|
}
|
|
120
245
|
static interactionMetadataFromRaw(interactionMetadata) {
|
|
@@ -171,11 +296,136 @@ class Interactions {
|
|
|
171
296
|
components: interaction.data?.components?.map((component) => {
|
|
172
297
|
switch (component.type) {
|
|
173
298
|
case constants_1.ComponentTypes.ActionRow:
|
|
174
|
-
return
|
|
299
|
+
return {
|
|
300
|
+
type: constants_1.ComponentTypes.ActionRow,
|
|
301
|
+
components: component.components.map((c) => {
|
|
302
|
+
switch (c.type) {
|
|
303
|
+
case constants_1.ComponentTypes.TextInput:
|
|
304
|
+
return {
|
|
305
|
+
type: c.type,
|
|
306
|
+
id: c.id,
|
|
307
|
+
custom_id: c.customID,
|
|
308
|
+
value: c.value,
|
|
309
|
+
};
|
|
310
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
311
|
+
return {
|
|
312
|
+
type: c.type,
|
|
313
|
+
component_type: c.componentType,
|
|
314
|
+
id: c.id,
|
|
315
|
+
custom_id: c.customID,
|
|
316
|
+
values: c.values,
|
|
317
|
+
};
|
|
318
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
319
|
+
return {
|
|
320
|
+
type: c.type,
|
|
321
|
+
component_type: c.componentType,
|
|
322
|
+
id: c.id,
|
|
323
|
+
custom_id: c.customID,
|
|
324
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
325
|
+
values: c.values,
|
|
326
|
+
};
|
|
327
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
328
|
+
return {
|
|
329
|
+
type: c.type,
|
|
330
|
+
component_type: c.componentType,
|
|
331
|
+
id: c.id,
|
|
332
|
+
custom_id: c.customID,
|
|
333
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
334
|
+
values: c.values,
|
|
335
|
+
};
|
|
336
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
337
|
+
return {
|
|
338
|
+
type: c.type,
|
|
339
|
+
component_type: c.componentType,
|
|
340
|
+
id: c.id,
|
|
341
|
+
custom_id: c.customID,
|
|
342
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
343
|
+
values: c.values,
|
|
344
|
+
};
|
|
345
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
346
|
+
return {
|
|
347
|
+
type: c.type,
|
|
348
|
+
component_type: c.componentType,
|
|
349
|
+
id: c.id,
|
|
350
|
+
custom_id: c.customID,
|
|
351
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
352
|
+
values: c.values,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}),
|
|
356
|
+
};
|
|
175
357
|
case constants_1.ComponentTypes.TextDisplay:
|
|
176
|
-
return
|
|
177
|
-
|
|
178
|
-
|
|
358
|
+
return {
|
|
359
|
+
type: component.type,
|
|
360
|
+
id: component.id,
|
|
361
|
+
};
|
|
362
|
+
case constants_1.ComponentTypes.Label: {
|
|
363
|
+
let c;
|
|
364
|
+
switch (component.component.type) {
|
|
365
|
+
case constants_1.ComponentTypes.TextInput:
|
|
366
|
+
c = {
|
|
367
|
+
type: component.component.type,
|
|
368
|
+
id: component.component.id,
|
|
369
|
+
custom_id: component.component.customID,
|
|
370
|
+
value: component.component.value,
|
|
371
|
+
};
|
|
372
|
+
break;
|
|
373
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
374
|
+
c = {
|
|
375
|
+
type: component.component.type,
|
|
376
|
+
component_type: component.component.componentType,
|
|
377
|
+
id: component.component.id,
|
|
378
|
+
custom_id: component.component.customID,
|
|
379
|
+
values: component.component.values,
|
|
380
|
+
};
|
|
381
|
+
break;
|
|
382
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
383
|
+
c = {
|
|
384
|
+
type: component.component.type,
|
|
385
|
+
component_type: component.component.componentType,
|
|
386
|
+
id: component.component.id,
|
|
387
|
+
custom_id: component.component.customID,
|
|
388
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
389
|
+
values: component.component.values,
|
|
390
|
+
};
|
|
391
|
+
break;
|
|
392
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
393
|
+
c = {
|
|
394
|
+
type: component.component.type,
|
|
395
|
+
component_type: component.component.componentType,
|
|
396
|
+
id: component.component.id,
|
|
397
|
+
custom_id: component.component.customID,
|
|
398
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
399
|
+
values: component.component.values,
|
|
400
|
+
};
|
|
401
|
+
break;
|
|
402
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
403
|
+
c = {
|
|
404
|
+
type: component.component.type,
|
|
405
|
+
component_type: component.component.componentType,
|
|
406
|
+
id: component.component.id,
|
|
407
|
+
custom_id: component.component.customID,
|
|
408
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
409
|
+
values: component.component.values,
|
|
410
|
+
};
|
|
411
|
+
break;
|
|
412
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
413
|
+
c = {
|
|
414
|
+
type: component.component.type,
|
|
415
|
+
component_type: component.component.componentType,
|
|
416
|
+
id: component.component.id,
|
|
417
|
+
custom_id: component.component.customID,
|
|
418
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
419
|
+
values: component.component.values,
|
|
420
|
+
};
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
return {
|
|
424
|
+
type: component.type,
|
|
425
|
+
id: component.id,
|
|
426
|
+
component: c,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
179
429
|
}
|
|
180
430
|
}),
|
|
181
431
|
}
|
|
@@ -212,6 +462,7 @@ class Interactions {
|
|
|
212
462
|
"1": interaction.authorizingIntegrationOwners[1],
|
|
213
463
|
},
|
|
214
464
|
context: interaction.context,
|
|
465
|
+
attachment_size_limit: interaction.attachmentSizeLimit,
|
|
215
466
|
};
|
|
216
467
|
}
|
|
217
468
|
static resolvedDataFromRaw(resolvedData) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Lobby, LobbyMember, RawLobby, RawLobbyMember } from "../types/lobby";
|
|
2
|
+
export declare class Lobbies {
|
|
3
|
+
static lobbyFromRaw(lobby: RawLobby): Lobby;
|
|
4
|
+
static lobbyMemberFromRaw(lobbyMember: RawLobbyMember): LobbyMember;
|
|
5
|
+
static lobbyMemberToRaw(lobbyMember: LobbyMember): RawLobbyMember;
|
|
6
|
+
static lobbyToRaw(lobby: Lobby): RawLobby;
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Lobbies = void 0;
|
|
4
|
+
class Lobbies {
|
|
5
|
+
static lobbyFromRaw(lobby) {
|
|
6
|
+
return {
|
|
7
|
+
id: lobby.id,
|
|
8
|
+
applicationID: lobby.application_id,
|
|
9
|
+
metadata: lobby.metadata,
|
|
10
|
+
members: lobby.members,
|
|
11
|
+
linkedChannel: lobby.linked_channel,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static lobbyMemberFromRaw(lobbyMember) {
|
|
15
|
+
return {
|
|
16
|
+
id: lobbyMember.id,
|
|
17
|
+
metadata: lobbyMember.metadata,
|
|
18
|
+
flags: lobbyMember.flags,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static lobbyMemberToRaw(lobbyMember) {
|
|
22
|
+
return {
|
|
23
|
+
id: lobbyMember.id,
|
|
24
|
+
metadata: lobbyMember.metadata,
|
|
25
|
+
flags: lobbyMember.flags,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static lobbyToRaw(lobby) {
|
|
29
|
+
return {
|
|
30
|
+
id: lobby.id,
|
|
31
|
+
application_id: lobby.applicationID,
|
|
32
|
+
metadata: lobby.metadata,
|
|
33
|
+
members: lobby.members,
|
|
34
|
+
linked_channel: lobby.linkedChannel,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Lobbies = Lobbies;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RawAttachment, Attachment, RawEmbed, Embed, RawMessage, Message } from "../types/message";
|
|
2
|
-
import type { ActionRow,
|
|
2
|
+
import type { ActionRow, Container, File, MediaGallery, RawActionRow, RawContainer, RawFile, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "../types/message-components";
|
|
3
3
|
export declare class Messages {
|
|
4
4
|
static attachmentFromRaw(attachment: RawAttachment): Attachment;
|
|
5
5
|
static attachmentToRaw(attachment: Attachment): RawAttachment;
|
|
6
|
-
static componentsFromRaw(components: Array<RawActionRow |
|
|
7
|
-
static componentsToRaw(components: Array<ActionRow |
|
|
6
|
+
static componentsFromRaw(components: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer>): Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
7
|
+
static componentsToRaw(components: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>): Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer>;
|
|
8
8
|
static embedFromRaw(embed: RawEmbed): Embed;
|
|
9
9
|
static embedToRaw(embed: Embed): RawEmbed;
|
|
10
10
|
static messageFromRaw(message: RawMessage): Message;
|
|
@@ -53,24 +53,10 @@ class Messages {
|
|
|
53
53
|
switch (component.type) {
|
|
54
54
|
case constants_1.ComponentTypes.ActionRow:
|
|
55
55
|
return Components_js_1.Components.actionRowFromRaw(component);
|
|
56
|
-
case constants_1.ComponentTypes.Button:
|
|
57
|
-
return Components_js_1.Components.buttonFromRaw(component);
|
|
58
|
-
case constants_1.ComponentTypes.StringSelect:
|
|
59
|
-
return Components_js_1.Components.stringSelectFromRaw(component);
|
|
60
|
-
case constants_1.ComponentTypes.UserSelect:
|
|
61
|
-
return Components_js_1.Components.userSelectFromRaw(component);
|
|
62
|
-
case constants_1.ComponentTypes.RoleSelect:
|
|
63
|
-
return Components_js_1.Components.roleSelectFromRaw(component);
|
|
64
|
-
case constants_1.ComponentTypes.MentionableSelect:
|
|
65
|
-
return Components_js_1.Components.mentionableSelectFromRaw(component);
|
|
66
|
-
case constants_1.ComponentTypes.ChannelSelect:
|
|
67
|
-
return Components_js_1.Components.channelSelectFromRaw(component);
|
|
68
56
|
case constants_1.ComponentTypes.Section:
|
|
69
57
|
return Components_js_1.Components.sectionFromRaw(component);
|
|
70
58
|
case constants_1.ComponentTypes.TextDisplay:
|
|
71
59
|
return Components_js_1.Components.textDisplayFromRaw(component);
|
|
72
|
-
case constants_1.ComponentTypes.Thumbnail:
|
|
73
|
-
return Components_js_1.Components.thumbnailFromRaw(component);
|
|
74
60
|
case constants_1.ComponentTypes.MediaGallery:
|
|
75
61
|
return Components_js_1.Components.mediaGalleryFromRaw(component);
|
|
76
62
|
case constants_1.ComponentTypes.File:
|
|
@@ -87,24 +73,10 @@ class Messages {
|
|
|
87
73
|
switch (component.type) {
|
|
88
74
|
case constants_1.ComponentTypes.ActionRow:
|
|
89
75
|
return Components_js_1.Components.actionRowToRaw(component);
|
|
90
|
-
case constants_1.ComponentTypes.Button:
|
|
91
|
-
return Components_js_1.Components.buttonToRaw(component);
|
|
92
|
-
case constants_1.ComponentTypes.StringSelect:
|
|
93
|
-
return Components_js_1.Components.stringSelectToRaw(component);
|
|
94
|
-
case constants_1.ComponentTypes.UserSelect:
|
|
95
|
-
return Components_js_1.Components.userSelectToRaw(component);
|
|
96
|
-
case constants_1.ComponentTypes.RoleSelect:
|
|
97
|
-
return Components_js_1.Components.roleSelectToRaw(component);
|
|
98
|
-
case constants_1.ComponentTypes.MentionableSelect:
|
|
99
|
-
return Components_js_1.Components.mentionableSelectToRaw(component);
|
|
100
|
-
case constants_1.ComponentTypes.ChannelSelect:
|
|
101
|
-
return Components_js_1.Components.channelSelectToRaw(component);
|
|
102
76
|
case constants_1.ComponentTypes.Section:
|
|
103
77
|
return Components_js_1.Components.sectionToRaw(component);
|
|
104
78
|
case constants_1.ComponentTypes.TextDisplay:
|
|
105
79
|
return Components_js_1.Components.textDisplayToRaw(component);
|
|
106
|
-
case constants_1.ComponentTypes.Thumbnail:
|
|
107
|
-
return Components_js_1.Components.thumbnailToRaw(component);
|
|
108
80
|
case constants_1.ComponentTypes.MediaGallery:
|
|
109
81
|
return Components_js_1.Components.mediaGalleryToRaw(component);
|
|
110
82
|
case constants_1.ComponentTypes.File:
|
|
@@ -10,7 +10,7 @@ class Roles {
|
|
|
10
10
|
colors: {
|
|
11
11
|
primaryColor: role.colors.primary_color,
|
|
12
12
|
secondaryColor: role.colors.secondary_color,
|
|
13
|
-
|
|
13
|
+
tertiaryColor: role.colors.tertiary_color,
|
|
14
14
|
},
|
|
15
15
|
hoist: role.hoist,
|
|
16
16
|
icon: role.icon,
|
|
@@ -40,7 +40,7 @@ class Roles {
|
|
|
40
40
|
colors: {
|
|
41
41
|
primary_color: role.colors.primaryColor,
|
|
42
42
|
secondary_color: role.colors.secondaryColor,
|
|
43
|
-
|
|
43
|
+
tertiary_color: role.colors.tertiaryColor,
|
|
44
44
|
},
|
|
45
45
|
hoist: role.hoist,
|
|
46
46
|
icon: role.icon,
|
|
@@ -4,7 +4,7 @@ export * from "./Applications";
|
|
|
4
4
|
export * from "./AuditLogs";
|
|
5
5
|
export * from "./AutoModeration";
|
|
6
6
|
export * from "./Channels";
|
|
7
|
-
export * from "./Components
|
|
7
|
+
export * from "./Components";
|
|
8
8
|
export * from "./Emojis";
|
|
9
9
|
export * from "./Entitlements";
|
|
10
10
|
export * from "./Guilds";
|
|
@@ -12,6 +12,7 @@ export * from "./GuildScheduledEvents";
|
|
|
12
12
|
export * from "./GuildTemplates";
|
|
13
13
|
export * from "./Interactions";
|
|
14
14
|
export * from "./Invites";
|
|
15
|
+
export * from "./Lobbies";
|
|
15
16
|
export * from "./Messages";
|
|
16
17
|
export * from "./Polls";
|
|
17
18
|
export * from "./Presences";
|
|
@@ -20,7 +20,7 @@ __exportStar(require("./Applications"), exports);
|
|
|
20
20
|
__exportStar(require("./AuditLogs"), exports);
|
|
21
21
|
__exportStar(require("./AutoModeration"), exports);
|
|
22
22
|
__exportStar(require("./Channels"), exports);
|
|
23
|
-
__exportStar(require("./Components
|
|
23
|
+
__exportStar(require("./Components"), exports);
|
|
24
24
|
__exportStar(require("./Emojis"), exports);
|
|
25
25
|
__exportStar(require("./Entitlements"), exports);
|
|
26
26
|
__exportStar(require("./Guilds"), exports);
|
|
@@ -28,6 +28,7 @@ __exportStar(require("./GuildScheduledEvents"), exports);
|
|
|
28
28
|
__exportStar(require("./GuildTemplates"), exports);
|
|
29
29
|
__exportStar(require("./Interactions"), exports);
|
|
30
30
|
__exportStar(require("./Invites"), exports);
|
|
31
|
+
__exportStar(require("./Lobbies"), exports);
|
|
31
32
|
__exportStar(require("./Messages"), exports);
|
|
32
33
|
__exportStar(require("./Polls"), exports);
|
|
33
34
|
__exportStar(require("./Presences"), exports);
|
|
@@ -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 {
|
|
@@ -556,6 +557,7 @@ export interface InviteCreateEventFields {
|
|
|
556
557
|
targetApplication?: Application;
|
|
557
558
|
temporary: boolean;
|
|
558
559
|
uses: number;
|
|
560
|
+
expiresAt: timestamp | null;
|
|
559
561
|
}
|
|
560
562
|
export interface InviteDeleteEventFields {
|
|
561
563
|
channelID: snowflake;
|
|
@@ -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 {
|
|
@@ -6,7 +6,7 @@ import type { snowflake } from "./common";
|
|
|
6
6
|
import type { RawEntitlement, Entitlement } from "./entitlements";
|
|
7
7
|
import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
|
|
8
8
|
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
|
|
9
|
-
import type { ActionRow,
|
|
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 "./message-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 {
|
|
@@ -54,7 +55,11 @@ export interface RawMessageComponentData {
|
|
|
54
55
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */
|
|
55
56
|
export interface RawModalSubmitData {
|
|
56
57
|
custom_id: string;
|
|
57
|
-
components: Array<
|
|
58
|
+
components: Array<{
|
|
59
|
+
type: ComponentTypes.ActionRow;
|
|
60
|
+
components: Array<RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse>;
|
|
61
|
+
} | RawTextDisplayInteractionResponse | RawLabelInteractionResponse>;
|
|
62
|
+
resolved?: RawResolvedData;
|
|
58
63
|
}
|
|
59
64
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
60
65
|
export interface RawResolvedData {
|
|
@@ -93,7 +98,7 @@ export interface RawInteractionCallbackData {
|
|
|
93
98
|
embeds?: Array<RawEmbed>;
|
|
94
99
|
allowed_mentions?: RawAllowedMentions;
|
|
95
100
|
flags?: MessageFlags;
|
|
96
|
-
components?: Array<RawActionRow |
|
|
101
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
97
102
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
98
103
|
poll?: RawPollCreateParams;
|
|
99
104
|
files?: Array<FileData>;
|
|
@@ -147,6 +152,7 @@ export interface Interaction {
|
|
|
147
152
|
entitlements: Array<Entitlement>;
|
|
148
153
|
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
|
149
154
|
context?: InteractionContextTypes;
|
|
155
|
+
attachmentSizeLimit: number;
|
|
150
156
|
}
|
|
151
157
|
export interface ApplicationCommandData {
|
|
152
158
|
id: snowflake;
|
|
@@ -165,7 +171,11 @@ export interface MessageComponentData {
|
|
|
165
171
|
}
|
|
166
172
|
export interface ModalSubmitData {
|
|
167
173
|
customID: string;
|
|
168
|
-
components: Array<
|
|
174
|
+
components: Array<{
|
|
175
|
+
type: ComponentTypes.ActionRow;
|
|
176
|
+
components: Array<TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse>;
|
|
177
|
+
} | TextDisplayInteractionResponse | LabelInteractionResponse>;
|
|
178
|
+
resolved?: ResolvedData;
|
|
169
179
|
}
|
|
170
180
|
export interface ResolvedData {
|
|
171
181
|
users?: Record<snowflake, User>;
|
|
@@ -199,7 +209,7 @@ export interface InteractionCallbackData {
|
|
|
199
209
|
embeds?: Array<Embed>;
|
|
200
210
|
allowedMentions?: AllowedMentions;
|
|
201
211
|
flags?: MessageFlags;
|
|
202
|
-
components?: Array<ActionRow |
|
|
212
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
203
213
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
204
214
|
poll?: PollCreateParams;
|
|
205
215
|
files?: Array<FileData>;
|
|
@@ -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
|
+
}
|