disgroove 2.2.7-dev.fca4921 → 3.0.0-dev.2cf2b90
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/LICENSE +9 -9
- package/README.md +48 -48
- package/dist/lib/Client.d.ts +332 -301
- package/dist/lib/Client.js +562 -462
- package/dist/lib/constants.d.ts +35 -24
- package/dist/lib/constants.js +39 -27
- package/dist/lib/gateway/Dispatcher.d.ts +104 -0
- package/dist/lib/gateway/Dispatcher.js +471 -0
- package/dist/lib/gateway/Shard.d.ts +12 -21
- package/dist/lib/gateway/Shard.js +121 -570
- package/dist/lib/gateway/Transmitter.d.ts +22 -0
- package/dist/lib/gateway/Transmitter.js +93 -0
- package/dist/lib/gateway/WebSocketManager.d.ts +22 -0
- package/dist/lib/gateway/WebSocketManager.js +93 -0
- 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/rest/RequestManager.js +17 -7
- package/dist/lib/rest/index.js +17 -7
- package/dist/lib/transformers/ApplicationCommands.js +4 -4
- package/dist/lib/transformers/Applications.d.ts +2 -0
- package/dist/lib/transformers/Applications.js +110 -4
- 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 +15 -3
- package/dist/lib/transformers/Components.js +309 -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 +330 -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 +38 -52
- package/dist/lib/transformers/Polls.js +2 -2
- package/dist/lib/transformers/Presences.d.ts +3 -3
- 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 +12 -7
- 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 +510 -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 +406 -207
- 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.d.ts +32 -20
- 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/errors.d.ts +3 -1
- package/dist/lib/utils/errors.js +4 -0
- package/dist/lib/utils/formatters.d.ts +7 -7
- package/dist/lib/utils/formatters.js +28 -29
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +18 -7
- package/dist/lib/utils/permissions.d.ts +2 -0
- package/dist/lib/utils/permissions.js +7 -0
- package/dist/package.json +4 -4
- package/package.json +5 -5
- package/dist/lib/types/message-components.d.ts +0 -234
- /package/dist/lib/types/{message-components.js → components.js} +0 -0
|
@@ -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,172 @@ 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
|
+
case constants_1.ComponentTypes.FileUpload:
|
|
132
|
+
return {
|
|
133
|
+
type: c.type,
|
|
134
|
+
id: c.id,
|
|
135
|
+
customId: c.custom_id,
|
|
136
|
+
values: c.values,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
};
|
|
141
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
142
|
+
return {
|
|
143
|
+
type: component.type,
|
|
144
|
+
id: component.id,
|
|
145
|
+
};
|
|
146
|
+
case constants_1.ComponentTypes.Label: {
|
|
147
|
+
let c;
|
|
148
|
+
switch (component.component.type) {
|
|
149
|
+
case constants_1.ComponentTypes.TextInput:
|
|
150
|
+
c = {
|
|
151
|
+
type: component.component.type,
|
|
152
|
+
id: component.component.id,
|
|
153
|
+
customId: component.component.custom_id,
|
|
154
|
+
value: component.component.value,
|
|
155
|
+
};
|
|
156
|
+
break;
|
|
157
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
158
|
+
c = {
|
|
159
|
+
type: component.component.type,
|
|
160
|
+
componentType: component.component.component_type,
|
|
161
|
+
id: component.component.id,
|
|
162
|
+
customId: component.component.custom_id,
|
|
163
|
+
values: component.component.values,
|
|
164
|
+
};
|
|
165
|
+
break;
|
|
166
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
167
|
+
c = {
|
|
168
|
+
type: component.component.type,
|
|
169
|
+
componentType: component.component.component_type,
|
|
170
|
+
id: component.component.id,
|
|
171
|
+
customId: component.component.custom_id,
|
|
172
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
173
|
+
values: component.component.values,
|
|
174
|
+
};
|
|
175
|
+
break;
|
|
176
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
177
|
+
c = {
|
|
178
|
+
type: component.component.type,
|
|
179
|
+
componentType: component.component.component_type,
|
|
180
|
+
id: component.component.id,
|
|
181
|
+
customId: component.component.custom_id,
|
|
182
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
183
|
+
values: component.component.values,
|
|
184
|
+
};
|
|
185
|
+
break;
|
|
186
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
187
|
+
c = {
|
|
188
|
+
type: component.component.type,
|
|
189
|
+
componentType: component.component.component_type,
|
|
190
|
+
id: component.component.id,
|
|
191
|
+
customId: component.component.custom_id,
|
|
192
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
193
|
+
values: component.component.values,
|
|
194
|
+
};
|
|
195
|
+
break;
|
|
196
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
197
|
+
c = {
|
|
198
|
+
type: component.component.type,
|
|
199
|
+
componentType: component.component.component_type,
|
|
200
|
+
id: component.component.id,
|
|
201
|
+
customId: component.component.custom_id,
|
|
202
|
+
resolved: this.resolvedDataFromRaw(component.component.resolved),
|
|
203
|
+
values: component.component.values,
|
|
204
|
+
};
|
|
205
|
+
break;
|
|
206
|
+
case constants_1.ComponentTypes.FileUpload:
|
|
207
|
+
c = {
|
|
208
|
+
type: component.component.type,
|
|
209
|
+
id: component.component.id,
|
|
210
|
+
customId: component.component.custom_id,
|
|
211
|
+
values: component.component.values,
|
|
212
|
+
};
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
type: component.type,
|
|
217
|
+
id: component.id,
|
|
218
|
+
component: c,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}),
|
|
86
223
|
}
|
|
87
224
|
: undefined,
|
|
88
225
|
guild: interaction.guild !== undefined
|
|
@@ -92,11 +229,11 @@ class Interactions {
|
|
|
92
229
|
features: interaction.guild.features,
|
|
93
230
|
}
|
|
94
231
|
: undefined,
|
|
95
|
-
|
|
232
|
+
guildId: interaction.guild_id,
|
|
96
233
|
channel: interaction.channel !== undefined
|
|
97
234
|
? Channels_1.Channels.channelFromRaw(interaction.channel)
|
|
98
235
|
: undefined,
|
|
99
|
-
|
|
236
|
+
channelId: interaction.channel_id,
|
|
100
237
|
member: interaction.member !== undefined
|
|
101
238
|
? Guilds_1.Guilds.guildMemberFromRaw(interaction.member)
|
|
102
239
|
: undefined,
|
|
@@ -117,6 +254,7 @@ class Interactions {
|
|
|
117
254
|
"1": interaction.authorizing_integration_owners[1],
|
|
118
255
|
},
|
|
119
256
|
context: interaction.context,
|
|
257
|
+
attachmentSizeLimit: interaction.attachment_size_limit,
|
|
120
258
|
};
|
|
121
259
|
}
|
|
122
260
|
static interactionMetadataFromRaw(interactionMetadata) {
|
|
@@ -128,8 +266,8 @@ class Interactions {
|
|
|
128
266
|
"0": interactionMetadata.authorizing_integration_owners[0],
|
|
129
267
|
"1": interactionMetadata.authorizing_integration_owners[1],
|
|
130
268
|
},
|
|
131
|
-
|
|
132
|
-
|
|
269
|
+
originalResponseMessageId: interactionMetadata.original_response_message_id,
|
|
270
|
+
interactedMessageId: interactionMetadata.interacted_message_id,
|
|
133
271
|
triggeringInteractionMetadata: interactionMetadata.triggering_interaction_metadata !== undefined
|
|
134
272
|
? Interactions.interactionMetadataFromRaw(interactionMetadata.triggering_interaction_metadata)
|
|
135
273
|
: undefined,
|
|
@@ -144,8 +282,8 @@ class Interactions {
|
|
|
144
282
|
"0": interactionMetadata.authorizingIntegrationOwners[0],
|
|
145
283
|
"1": interactionMetadata.authorizingIntegrationOwners[1],
|
|
146
284
|
},
|
|
147
|
-
original_response_message_id: interactionMetadata.
|
|
148
|
-
interacted_message_id: interactionMetadata.
|
|
285
|
+
original_response_message_id: interactionMetadata.originalResponseMessageId,
|
|
286
|
+
interacted_message_id: interactionMetadata.interactedMessageId,
|
|
149
287
|
triggering_interaction_metadata: interactionMetadata.triggeringInteractionMetadata !== undefined
|
|
150
288
|
? Interactions.interactionMetadataToRaw(interactionMetadata.triggeringInteractionMetadata)
|
|
151
289
|
: undefined,
|
|
@@ -154,7 +292,7 @@ class Interactions {
|
|
|
154
292
|
static interactionToRaw(interaction) {
|
|
155
293
|
return {
|
|
156
294
|
id: interaction.id,
|
|
157
|
-
application_id: interaction.
|
|
295
|
+
application_id: interaction.applicationId,
|
|
158
296
|
type: interaction.type,
|
|
159
297
|
data: interaction.data !== undefined
|
|
160
298
|
? {
|
|
@@ -165,25 +303,161 @@ class Interactions {
|
|
|
165
303
|
? Interactions.resolvedDataToRaw(interaction.data.resolved)
|
|
166
304
|
: undefined,
|
|
167
305
|
options: interaction.data.options,
|
|
168
|
-
guild_id: interaction.data.
|
|
169
|
-
target_id: interaction.data.
|
|
170
|
-
custom_id: interaction.data.
|
|
306
|
+
guild_id: interaction.data.guildId,
|
|
307
|
+
target_id: interaction.data.targetId,
|
|
308
|
+
custom_id: interaction.data.customId,
|
|
171
309
|
component_type: interaction.data.componentType,
|
|
172
310
|
values: interaction.data.values,
|
|
173
|
-
components: interaction.data
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
311
|
+
components: interaction.data?.components?.map((component) => {
|
|
312
|
+
switch (component.type) {
|
|
313
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
314
|
+
return {
|
|
315
|
+
type: constants_1.ComponentTypes.ActionRow,
|
|
316
|
+
components: component.components.map((c) => {
|
|
317
|
+
switch (c.type) {
|
|
318
|
+
case constants_1.ComponentTypes.TextInput:
|
|
319
|
+
return {
|
|
320
|
+
type: c.type,
|
|
321
|
+
id: c.id,
|
|
322
|
+
custom_id: c.customId,
|
|
323
|
+
value: c.value,
|
|
324
|
+
};
|
|
325
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
326
|
+
return {
|
|
327
|
+
type: c.type,
|
|
328
|
+
component_type: c.componentType,
|
|
329
|
+
id: c.id,
|
|
330
|
+
custom_id: c.customId,
|
|
331
|
+
values: c.values,
|
|
332
|
+
};
|
|
333
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
334
|
+
return {
|
|
335
|
+
type: c.type,
|
|
336
|
+
component_type: c.componentType,
|
|
337
|
+
id: c.id,
|
|
338
|
+
custom_id: c.customId,
|
|
339
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
340
|
+
values: c.values,
|
|
341
|
+
};
|
|
342
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
343
|
+
return {
|
|
344
|
+
type: c.type,
|
|
345
|
+
component_type: c.componentType,
|
|
346
|
+
id: c.id,
|
|
347
|
+
custom_id: c.customId,
|
|
348
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
349
|
+
values: c.values,
|
|
350
|
+
};
|
|
351
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
352
|
+
return {
|
|
353
|
+
type: c.type,
|
|
354
|
+
component_type: c.componentType,
|
|
355
|
+
id: c.id,
|
|
356
|
+
custom_id: c.customId,
|
|
357
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
358
|
+
values: c.values,
|
|
359
|
+
};
|
|
360
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
361
|
+
return {
|
|
362
|
+
type: c.type,
|
|
363
|
+
component_type: c.componentType,
|
|
364
|
+
id: c.id,
|
|
365
|
+
custom_id: c.customId,
|
|
366
|
+
resolved: this.resolvedDataToRaw(c.resolved),
|
|
367
|
+
values: c.values,
|
|
368
|
+
};
|
|
369
|
+
case constants_1.ComponentTypes.FileUpload:
|
|
370
|
+
return {
|
|
371
|
+
type: c.type,
|
|
372
|
+
id: c.id,
|
|
373
|
+
custom_id: c.customId,
|
|
374
|
+
values: c.values,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
}),
|
|
378
|
+
};
|
|
379
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
380
|
+
return {
|
|
381
|
+
type: component.type,
|
|
382
|
+
id: component.id,
|
|
383
|
+
};
|
|
384
|
+
case constants_1.ComponentTypes.Label: {
|
|
385
|
+
let c;
|
|
386
|
+
switch (component.component.type) {
|
|
387
|
+
case constants_1.ComponentTypes.TextInput:
|
|
388
|
+
c = {
|
|
389
|
+
type: component.component.type,
|
|
390
|
+
id: component.component.id,
|
|
391
|
+
custom_id: component.component.customId,
|
|
392
|
+
value: component.component.value,
|
|
393
|
+
};
|
|
394
|
+
break;
|
|
395
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
396
|
+
c = {
|
|
397
|
+
type: component.component.type,
|
|
398
|
+
component_type: component.component.componentType,
|
|
399
|
+
id: component.component.id,
|
|
400
|
+
custom_id: component.component.customId,
|
|
401
|
+
values: component.component.values,
|
|
402
|
+
};
|
|
403
|
+
break;
|
|
404
|
+
case constants_1.ComponentTypes.UserSelect:
|
|
405
|
+
c = {
|
|
406
|
+
type: component.component.type,
|
|
407
|
+
component_type: component.component.componentType,
|
|
408
|
+
id: component.component.id,
|
|
409
|
+
custom_id: component.component.customId,
|
|
410
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
411
|
+
values: component.component.values,
|
|
412
|
+
};
|
|
413
|
+
break;
|
|
414
|
+
case constants_1.ComponentTypes.RoleSelect:
|
|
415
|
+
c = {
|
|
416
|
+
type: component.component.type,
|
|
417
|
+
component_type: component.component.componentType,
|
|
418
|
+
id: component.component.id,
|
|
419
|
+
custom_id: component.component.customId,
|
|
420
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
421
|
+
values: component.component.values,
|
|
422
|
+
};
|
|
423
|
+
break;
|
|
424
|
+
case constants_1.ComponentTypes.MentionableSelect:
|
|
425
|
+
c = {
|
|
426
|
+
type: component.component.type,
|
|
427
|
+
component_type: component.component.componentType,
|
|
428
|
+
id: component.component.id,
|
|
429
|
+
custom_id: component.component.customId,
|
|
430
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
431
|
+
values: component.component.values,
|
|
432
|
+
};
|
|
433
|
+
break;
|
|
434
|
+
case constants_1.ComponentTypes.ChannelSelect:
|
|
435
|
+
c = {
|
|
436
|
+
type: component.component.type,
|
|
437
|
+
component_type: component.component.componentType,
|
|
438
|
+
id: component.component.id,
|
|
439
|
+
custom_id: component.component.customId,
|
|
440
|
+
resolved: this.resolvedDataToRaw(component.component.resolved),
|
|
441
|
+
values: component.component.values,
|
|
442
|
+
};
|
|
443
|
+
break;
|
|
444
|
+
case constants_1.ComponentTypes.FileUpload:
|
|
445
|
+
c = {
|
|
446
|
+
type: component.component.type,
|
|
447
|
+
id: component.component.id,
|
|
448
|
+
custom_id: component.component.customId,
|
|
449
|
+
values: component.component.values,
|
|
450
|
+
};
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
return {
|
|
454
|
+
type: component.type,
|
|
455
|
+
id: component.id,
|
|
456
|
+
component: c,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}),
|
|
187
461
|
}
|
|
188
462
|
: undefined,
|
|
189
463
|
guild: interaction.guild !== undefined
|
|
@@ -193,11 +467,11 @@ class Interactions {
|
|
|
193
467
|
features: interaction.guild.features,
|
|
194
468
|
}
|
|
195
469
|
: undefined,
|
|
196
|
-
guild_id: interaction.
|
|
470
|
+
guild_id: interaction.guildId,
|
|
197
471
|
channel: interaction.channel !== undefined
|
|
198
472
|
? Channels_1.Channels.channelToRaw(interaction.channel)
|
|
199
473
|
: undefined,
|
|
200
|
-
channel_id: interaction.
|
|
474
|
+
channel_id: interaction.channelId,
|
|
201
475
|
member: interaction.member !== undefined
|
|
202
476
|
? Guilds_1.Guilds.guildMemberToRaw(interaction.member)
|
|
203
477
|
: undefined,
|
|
@@ -218,6 +492,7 @@ class Interactions {
|
|
|
218
492
|
"1": interaction.authorizingIntegrationOwners[1],
|
|
219
493
|
},
|
|
220
494
|
context: interaction.context,
|
|
495
|
+
attachment_size_limit: interaction.attachmentSizeLimit,
|
|
221
496
|
};
|
|
222
497
|
}
|
|
223
498
|
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;
|