disgroove 2.2.7-dev.fca4921 → 3.0.0-dev.a714eda
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 +291 -254
- package/dist/lib/Client.js +554 -460
- package/dist/lib/constants.d.ts +29 -21
- package/dist/lib/constants.js +33 -24
- package/dist/lib/gateway/Shard.d.ts +5 -3
- package/dist/lib/gateway/Shard.js +183 -120
- package/dist/lib/index.d.ts +5 -1
- package/dist/lib/index.js +5 -1
- package/dist/lib/rest/Endpoints.d.ts +95 -91
- package/dist/lib/rest/Endpoints.js +111 -102
- package/dist/lib/rest/RequestManager.d.ts +1 -3
- package/dist/lib/transformers/ApplicationCommands.js +4 -4
- package/dist/lib/transformers/Applications.js +14 -6
- package/dist/lib/transformers/AuditLogs.js +10 -10
- package/dist/lib/transformers/AutoModeration.js +6 -6
- package/dist/lib/transformers/Channels.js +16 -16
- package/dist/lib/transformers/Components.d.ts +13 -3
- package/dist/lib/transformers/Components.js +283 -156
- package/dist/lib/transformers/Entitlements.d.ts +2 -2
- package/dist/lib/transformers/Entitlements.js +16 -16
- package/dist/lib/transformers/GuildScheduledEvents.js +8 -8
- package/dist/lib/transformers/GuildTemplates.js +4 -4
- package/dist/lib/transformers/Guilds.js +28 -28
- package/dist/lib/transformers/Interactions.js +300 -55
- 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 +36 -50
- package/dist/lib/transformers/Polls.js +2 -2
- package/dist/lib/transformers/Presences.js +6 -6
- package/dist/lib/transformers/Roles.js +8 -8
- package/dist/lib/transformers/SKUs.js +2 -2
- package/dist/lib/transformers/Soundboards.js +6 -6
- package/dist/lib/transformers/StageInstances.js +6 -6
- package/dist/lib/transformers/Stickers.js +3 -3
- package/dist/lib/transformers/Subscriptions.js +8 -8
- package/dist/lib/transformers/Teams.js +4 -4
- package/dist/lib/transformers/Users.js +6 -6
- package/dist/lib/transformers/Voice.js +8 -8
- package/dist/lib/transformers/Webhooks.js +6 -6
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/application-command.d.ts +9 -4
- package/dist/lib/types/application-role-connection-metadata.d.ts +1 -0
- package/dist/lib/types/application.d.ts +14 -9
- package/dist/lib/types/audit-log.d.ts +9 -5
- package/dist/lib/types/auto-moderation.d.ts +7 -3
- package/dist/lib/types/channel.d.ts +17 -23
- package/dist/lib/types/common.d.ts +2 -0
- package/dist/lib/types/components.d.ts +478 -0
- package/dist/lib/types/components.js +2 -0
- package/dist/lib/types/emoji.d.ts +1 -0
- package/dist/lib/types/entitlements.d.ts +5 -4
- package/dist/lib/types/gateway-events.d.ts +203 -130
- package/dist/lib/types/guild-scheduled-event.d.ts +10 -5
- package/dist/lib/types/guild-template.d.ts +3 -2
- package/dist/lib/types/guild.d.ts +40 -22
- package/dist/lib/types/interaction.d.ts +35 -18
- package/dist/lib/types/invite.d.ts +5 -2
- package/dist/lib/types/lobby.d.ts +31 -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 +30 -18
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +8 -5
- package/dist/lib/types/sku.d.ts +2 -1
- package/dist/lib/types/soundboard.d.ts +4 -3
- package/dist/lib/types/stage-instance.d.ts +4 -3
- package/dist/lib/types/sticker.d.ts +8 -5
- package/dist/lib/types/subscription.d.ts +6 -5
- package/dist/lib/types/team.d.ts +4 -2
- package/dist/lib/types/user.d.ts +10 -3
- package/dist/lib/types/voice.d.ts +6 -4
- package/dist/lib/types/webhook.d.ts +4 -3
- package/dist/lib/utils/CDN.d.ts +22 -22
- package/dist/lib/utils/CDN.js +22 -22
- package/dist/lib/utils/formatters.d.ts +7 -7
- package/dist/lib/utils/formatters.js +19 -19
- package/dist/package.json +4 -4
- package/package.json +4 -4
|
@@ -7,14 +7,15 @@ const Users_1 = require("./Users");
|
|
|
7
7
|
const Entitlements_1 = require("./Entitlements");
|
|
8
8
|
const Roles_1 = require("./Roles");
|
|
9
9
|
const Messages_1 = require("./Messages");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
10
11
|
class Interactions {
|
|
11
12
|
static interactionCallbackResponseFromRaw(interactionCallbackResponse) {
|
|
12
13
|
return {
|
|
13
14
|
interaction: {
|
|
14
15
|
id: interactionCallbackResponse.interaction.id,
|
|
15
16
|
type: interactionCallbackResponse.interaction.type,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
activityInstanceId: interactionCallbackResponse.interaction.activity_instance_id,
|
|
18
|
+
responseMessageId: interactionCallbackResponse.interaction.response_message_id,
|
|
18
19
|
responseMessageLoading: interactionCallbackResponse.interaction.response_message_loading,
|
|
19
20
|
responseMessageEphemeral: interactionCallbackResponse.interaction.response_message_ephemeral,
|
|
20
21
|
},
|
|
@@ -34,8 +35,8 @@ class Interactions {
|
|
|
34
35
|
interaction: {
|
|
35
36
|
id: interactionCallbackResponse.interaction.id,
|
|
36
37
|
type: interactionCallbackResponse.interaction.type,
|
|
37
|
-
activity_instance_id: interactionCallbackResponse.interaction.
|
|
38
|
-
response_message_id: interactionCallbackResponse.interaction.
|
|
38
|
+
activity_instance_id: interactionCallbackResponse.interaction.activityInstanceId,
|
|
39
|
+
response_message_id: interactionCallbackResponse.interaction.responseMessageId,
|
|
39
40
|
response_message_loading: interactionCallbackResponse.interaction.responseMessageLoading,
|
|
40
41
|
response_message_ephemeral: interactionCallbackResponse.interaction.responseMessageEphemeral,
|
|
41
42
|
},
|
|
@@ -53,36 +54,157 @@ class Interactions {
|
|
|
53
54
|
static interactionFromRaw(interaction) {
|
|
54
55
|
return {
|
|
55
56
|
id: interaction.id,
|
|
56
|
-
|
|
57
|
+
applicationId: interaction.application_id,
|
|
57
58
|
type: interaction.type,
|
|
58
59
|
data: interaction.data !== undefined
|
|
59
60
|
? {
|
|
60
|
-
id: interaction.data
|
|
61
|
-
name: interaction.data
|
|
62
|
-
type: interaction.data
|
|
63
|
-
resolved: interaction.data
|
|
61
|
+
id: interaction.data?.id,
|
|
62
|
+
name: interaction.data?.name,
|
|
63
|
+
type: interaction.data?.type,
|
|
64
|
+
resolved: interaction.data?.resolved !== undefined
|
|
64
65
|
? Interactions.resolvedDataFromRaw(interaction.data.resolved)
|
|
65
66
|
: undefined,
|
|
66
|
-
options: interaction.data
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
componentType: interaction.data
|
|
71
|
-
values: interaction.data
|
|
72
|
-
components: interaction.data
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
options: interaction.data?.options,
|
|
68
|
+
guildId: interaction.data?.guild_id,
|
|
69
|
+
targetId: interaction.data?.target_id,
|
|
70
|
+
customId: interaction.data?.custom_id,
|
|
71
|
+
componentType: interaction.data?.component_type,
|
|
72
|
+
values: interaction.data?.values,
|
|
73
|
+
components: interaction.data?.components?.map((component) => {
|
|
74
|
+
switch (component.type) {
|
|
75
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
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
|
+
};
|
|
134
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
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
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}),
|
|
86
208
|
}
|
|
87
209
|
: undefined,
|
|
88
210
|
guild: interaction.guild !== undefined
|
|
@@ -92,11 +214,11 @@ class Interactions {
|
|
|
92
214
|
features: interaction.guild.features,
|
|
93
215
|
}
|
|
94
216
|
: undefined,
|
|
95
|
-
|
|
217
|
+
guildId: interaction.guild_id,
|
|
96
218
|
channel: interaction.channel !== undefined
|
|
97
219
|
? Channels_1.Channels.channelFromRaw(interaction.channel)
|
|
98
220
|
: undefined,
|
|
99
|
-
|
|
221
|
+
channelId: interaction.channel_id,
|
|
100
222
|
member: interaction.member !== undefined
|
|
101
223
|
? Guilds_1.Guilds.guildMemberFromRaw(interaction.member)
|
|
102
224
|
: undefined,
|
|
@@ -117,6 +239,7 @@ class Interactions {
|
|
|
117
239
|
"1": interaction.authorizing_integration_owners[1],
|
|
118
240
|
},
|
|
119
241
|
context: interaction.context,
|
|
242
|
+
attachmentSizeLimit: interaction.attachment_size_limit,
|
|
120
243
|
};
|
|
121
244
|
}
|
|
122
245
|
static interactionMetadataFromRaw(interactionMetadata) {
|
|
@@ -128,8 +251,8 @@ class Interactions {
|
|
|
128
251
|
"0": interactionMetadata.authorizing_integration_owners[0],
|
|
129
252
|
"1": interactionMetadata.authorizing_integration_owners[1],
|
|
130
253
|
},
|
|
131
|
-
|
|
132
|
-
|
|
254
|
+
originalResponseMessageId: interactionMetadata.original_response_message_id,
|
|
255
|
+
interactedMessageId: interactionMetadata.interacted_message_id,
|
|
133
256
|
triggeringInteractionMetadata: interactionMetadata.triggering_interaction_metadata !== undefined
|
|
134
257
|
? Interactions.interactionMetadataFromRaw(interactionMetadata.triggering_interaction_metadata)
|
|
135
258
|
: undefined,
|
|
@@ -144,8 +267,8 @@ class Interactions {
|
|
|
144
267
|
"0": interactionMetadata.authorizingIntegrationOwners[0],
|
|
145
268
|
"1": interactionMetadata.authorizingIntegrationOwners[1],
|
|
146
269
|
},
|
|
147
|
-
original_response_message_id: interactionMetadata.
|
|
148
|
-
interacted_message_id: interactionMetadata.
|
|
270
|
+
original_response_message_id: interactionMetadata.originalResponseMessageId,
|
|
271
|
+
interacted_message_id: interactionMetadata.interactedMessageId,
|
|
149
272
|
triggering_interaction_metadata: interactionMetadata.triggeringInteractionMetadata !== undefined
|
|
150
273
|
? Interactions.interactionMetadataToRaw(interactionMetadata.triggeringInteractionMetadata)
|
|
151
274
|
: undefined,
|
|
@@ -154,7 +277,7 @@ class Interactions {
|
|
|
154
277
|
static interactionToRaw(interaction) {
|
|
155
278
|
return {
|
|
156
279
|
id: interaction.id,
|
|
157
|
-
application_id: interaction.
|
|
280
|
+
application_id: interaction.applicationId,
|
|
158
281
|
type: interaction.type,
|
|
159
282
|
data: interaction.data !== undefined
|
|
160
283
|
? {
|
|
@@ -165,25 +288,146 @@ class Interactions {
|
|
|
165
288
|
? Interactions.resolvedDataToRaw(interaction.data.resolved)
|
|
166
289
|
: undefined,
|
|
167
290
|
options: interaction.data.options,
|
|
168
|
-
guild_id: interaction.data.
|
|
169
|
-
target_id: interaction.data.
|
|
170
|
-
custom_id: interaction.data.
|
|
291
|
+
guild_id: interaction.data.guildId,
|
|
292
|
+
target_id: interaction.data.targetId,
|
|
293
|
+
custom_id: interaction.data.customId,
|
|
171
294
|
component_type: interaction.data.componentType,
|
|
172
295
|
values: interaction.data.values,
|
|
173
|
-
components: interaction.data
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
296
|
+
components: interaction.data?.components?.map((component) => {
|
|
297
|
+
switch (component.type) {
|
|
298
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
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
|
+
};
|
|
357
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
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
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}),
|
|
187
431
|
}
|
|
188
432
|
: undefined,
|
|
189
433
|
guild: interaction.guild !== undefined
|
|
@@ -193,11 +437,11 @@ class Interactions {
|
|
|
193
437
|
features: interaction.guild.features,
|
|
194
438
|
}
|
|
195
439
|
: undefined,
|
|
196
|
-
guild_id: interaction.
|
|
440
|
+
guild_id: interaction.guildId,
|
|
197
441
|
channel: interaction.channel !== undefined
|
|
198
442
|
? Channels_1.Channels.channelToRaw(interaction.channel)
|
|
199
443
|
: undefined,
|
|
200
|
-
channel_id: interaction.
|
|
444
|
+
channel_id: interaction.channelId,
|
|
201
445
|
member: interaction.member !== undefined
|
|
202
446
|
? Guilds_1.Guilds.guildMemberToRaw(interaction.member)
|
|
203
447
|
: undefined,
|
|
@@ -218,6 +462,7 @@ class Interactions {
|
|
|
218
462
|
"1": interaction.authorizingIntegrationOwners[1],
|
|
219
463
|
},
|
|
220
464
|
context: interaction.context,
|
|
465
|
+
attachment_size_limit: interaction.attachmentSizeLimit,
|
|
221
466
|
};
|
|
222
467
|
}
|
|
223
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,9 +1,10 @@
|
|
|
1
|
-
import { RawAttachment, Attachment, RawEmbed, Embed, RawMessage, Message
|
|
1
|
+
import { RawAttachment, Attachment, RawEmbed, Embed, RawMessage, Message } from "../types/message";
|
|
2
|
+
import type { ActionRow, Container, File, MediaGallery, RawActionRow, RawContainer, RawFile, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "../types/components";
|
|
2
3
|
export declare class Messages {
|
|
3
4
|
static attachmentFromRaw(attachment: RawAttachment): Attachment;
|
|
4
5
|
static attachmentToRaw(attachment: Attachment): RawAttachment;
|
|
5
|
-
static componentsFromRaw(components: Array<
|
|
6
|
-
static componentsToRaw(components: Array<
|
|
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>;
|
|
7
8
|
static embedFromRaw(embed: RawEmbed): Embed;
|
|
8
9
|
static embedToRaw(embed: Embed): RawEmbed;
|
|
9
10
|
static messageFromRaw(message: RawMessage): Message;
|