disgroove 2.2.7-dev.2c78f2c → 2.2.7-dev.4784073
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 +40 -8
- package/dist/lib/Client.js +98 -2
- package/dist/lib/constants.d.ts +5 -0
- package/dist/lib/constants.js +7 -1
- 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 +54 -24
- package/dist/lib/transformers/Interactions.js +110 -12
- 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/guild.d.ts +7 -5
- package/dist/lib/types/interaction.d.ts +17 -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 +93 -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
|
@@ -73,12 +73,60 @@ class Interactions {
|
|
|
73
73
|
values: interaction.data?.values,
|
|
74
74
|
components: interaction.data?.components?.map((component) => {
|
|
75
75
|
switch (component.type) {
|
|
76
|
-
case constants_1.ComponentTypes.
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
77
|
+
return {
|
|
78
|
+
type: constants_1.ComponentTypes.ActionRow,
|
|
79
|
+
components: component.components.map((c) => {
|
|
80
|
+
switch (c.type) {
|
|
81
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
82
|
+
return {
|
|
83
|
+
type: c.type,
|
|
84
|
+
componentType: c.component_type,
|
|
85
|
+
id: c.id,
|
|
86
|
+
customID: c.custom_id,
|
|
87
|
+
values: c.values,
|
|
88
|
+
};
|
|
89
|
+
case constants_1.ComponentTypes.TextInput:
|
|
90
|
+
return {
|
|
91
|
+
type: c.type,
|
|
92
|
+
id: c.id,
|
|
93
|
+
customID: c.custom_id,
|
|
94
|
+
value: c.value,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
100
|
+
return Components_1.Components.textDisplayFromRaw(component);
|
|
101
|
+
case constants_1.ComponentTypes.Label: {
|
|
102
|
+
let c;
|
|
103
|
+
switch (component.component.type) {
|
|
104
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
105
|
+
c = {
|
|
106
|
+
type: component.component.type,
|
|
107
|
+
componentType: component.component.component_type,
|
|
108
|
+
id: component.component.id,
|
|
109
|
+
customID: component.component.custom_id,
|
|
110
|
+
values: component.component.values,
|
|
111
|
+
};
|
|
112
|
+
break;
|
|
113
|
+
case constants_1.ComponentTypes.TextInput:
|
|
114
|
+
c = {
|
|
115
|
+
type: component.component.type,
|
|
116
|
+
id: component.component.id,
|
|
117
|
+
customID: component.component.custom_id,
|
|
118
|
+
value: component.component.value,
|
|
119
|
+
};
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
type: component.type,
|
|
124
|
+
id: component.id,
|
|
125
|
+
label: component.label,
|
|
126
|
+
description: component.description,
|
|
127
|
+
component: c,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
82
130
|
}
|
|
83
131
|
}),
|
|
84
132
|
}
|
|
@@ -115,6 +163,7 @@ class Interactions {
|
|
|
115
163
|
"1": interaction.authorizing_integration_owners[1],
|
|
116
164
|
},
|
|
117
165
|
context: interaction.context,
|
|
166
|
+
attachmentSizeLimit: interaction.attachment_size_limit,
|
|
118
167
|
};
|
|
119
168
|
}
|
|
120
169
|
static interactionMetadataFromRaw(interactionMetadata) {
|
|
@@ -170,12 +219,60 @@ class Interactions {
|
|
|
170
219
|
values: interaction.data.values,
|
|
171
220
|
components: interaction.data?.components?.map((component) => {
|
|
172
221
|
switch (component.type) {
|
|
173
|
-
case constants_1.ComponentTypes.
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
222
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
223
|
+
return {
|
|
224
|
+
type: constants_1.ComponentTypes.ActionRow,
|
|
225
|
+
components: component.components.map((c) => {
|
|
226
|
+
switch (c.type) {
|
|
227
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
228
|
+
return {
|
|
229
|
+
type: c.type,
|
|
230
|
+
component_type: c.componentType,
|
|
231
|
+
id: c.id,
|
|
232
|
+
custom_id: c.customID,
|
|
233
|
+
values: c.values,
|
|
234
|
+
};
|
|
235
|
+
case constants_1.ComponentTypes.TextInput:
|
|
236
|
+
return {
|
|
237
|
+
type: c.type,
|
|
238
|
+
id: c.id,
|
|
239
|
+
custom_id: c.customID,
|
|
240
|
+
value: c.value,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}),
|
|
244
|
+
};
|
|
245
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
246
|
+
return Components_1.Components.textDisplayToRaw(component);
|
|
247
|
+
case constants_1.ComponentTypes.Label: {
|
|
248
|
+
let c;
|
|
249
|
+
switch (component.component.type) {
|
|
250
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
251
|
+
c = {
|
|
252
|
+
type: component.component.type,
|
|
253
|
+
component_type: component.component.componentType,
|
|
254
|
+
id: component.component.id,
|
|
255
|
+
custom_id: component.component.customID,
|
|
256
|
+
values: component.component.values,
|
|
257
|
+
};
|
|
258
|
+
break;
|
|
259
|
+
case constants_1.ComponentTypes.TextInput:
|
|
260
|
+
c = {
|
|
261
|
+
type: component.component.type,
|
|
262
|
+
id: component.component.id,
|
|
263
|
+
custom_id: component.component.customID,
|
|
264
|
+
value: component.component.value,
|
|
265
|
+
};
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
type: component.type,
|
|
270
|
+
id: component.id,
|
|
271
|
+
label: component.label,
|
|
272
|
+
description: component.description,
|
|
273
|
+
component: c,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
179
276
|
}
|
|
180
277
|
}),
|
|
181
278
|
}
|
|
@@ -212,6 +309,7 @@ class Interactions {
|
|
|
212
309
|
"1": interaction.authorizingIntegrationOwners[1],
|
|
213
310
|
},
|
|
214
311
|
context: interaction.context,
|
|
312
|
+
attachment_size_limit: interaction.attachmentSizeLimit,
|
|
215
313
|
};
|
|
216
314
|
}
|
|
217
315
|
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);
|
|
@@ -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, Container, File, Label, MediaGallery, RawActionRow, RawContainer, RawFile, RawLabel, RawMediaGallery, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextInputInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextInputInteractionResponse } 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,12 @@ 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<RawStringSelectInteractionResponse | RawTextInputInteractionResponse>;
|
|
61
|
+
} | RawTextDisplay | (Omit<RawLabel, "component"> & {
|
|
62
|
+
component: RawStringSelectInteractionResponse | RawTextInputInteractionResponse;
|
|
63
|
+
})>;
|
|
58
64
|
}
|
|
59
65
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
60
66
|
export interface RawResolvedData {
|
|
@@ -93,7 +99,7 @@ export interface RawInteractionCallbackData {
|
|
|
93
99
|
embeds?: Array<RawEmbed>;
|
|
94
100
|
allowed_mentions?: RawAllowedMentions;
|
|
95
101
|
flags?: MessageFlags;
|
|
96
|
-
components?: Array<RawActionRow |
|
|
102
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
97
103
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
98
104
|
poll?: RawPollCreateParams;
|
|
99
105
|
files?: Array<FileData>;
|
|
@@ -147,6 +153,7 @@ export interface Interaction {
|
|
|
147
153
|
entitlements: Array<Entitlement>;
|
|
148
154
|
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
|
149
155
|
context?: InteractionContextTypes;
|
|
156
|
+
attachmentSizeLimit: number;
|
|
150
157
|
}
|
|
151
158
|
export interface ApplicationCommandData {
|
|
152
159
|
id: snowflake;
|
|
@@ -165,7 +172,12 @@ export interface MessageComponentData {
|
|
|
165
172
|
}
|
|
166
173
|
export interface ModalSubmitData {
|
|
167
174
|
customID: string;
|
|
168
|
-
components: Array<
|
|
175
|
+
components: Array<{
|
|
176
|
+
type: ComponentTypes.ActionRow;
|
|
177
|
+
components: Array<StringSelectInteractionResponse | TextInputInteractionResponse>;
|
|
178
|
+
} | TextDisplay | (Omit<Label, "component"> & {
|
|
179
|
+
component: StringSelectInteractionResponse | TextInputInteractionResponse;
|
|
180
|
+
})>;
|
|
169
181
|
}
|
|
170
182
|
export interface ResolvedData {
|
|
171
183
|
users?: Record<snowflake, User>;
|
|
@@ -199,7 +211,7 @@ export interface InteractionCallbackData {
|
|
|
199
211
|
embeds?: Array<Embed>;
|
|
200
212
|
allowedMentions?: AllowedMentions;
|
|
201
213
|
flags?: MessageFlags;
|
|
202
|
-
components?: Array<ActionRow |
|
|
214
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
203
215
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
204
216
|
poll?: PollCreateParams;
|
|
205
217
|
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
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ButtonStyles, ChannelTypes, ComponentTypes, SeparatorSpacing, TextInputStyles } from "../constants";
|
|
2
2
|
import type { snowflake } from "./common";
|
|
3
3
|
import type { RawEmoji, Emoji } from "./emoji";
|
|
4
|
+
import type { RawResolvedData, ResolvedData } from "./interaction";
|
|
4
5
|
/** https://discord.com/developers/docs/components/reference#action-row-action-row-structure */
|
|
5
6
|
export interface RawActionRow {
|
|
6
7
|
type: ComponentTypes.ActionRow;
|
|
7
|
-
components: Array<RawButton | RawStringSelect | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
|
|
8
|
+
components: Array<RawButton | RawStringSelect | RawTextInput | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
|
|
8
9
|
id?: number;
|
|
9
10
|
}
|
|
10
11
|
/** https://discord.com/developers/docs/components/reference#button-button-structure */
|
|
@@ -31,6 +32,14 @@ export interface RawStringSelect {
|
|
|
31
32
|
required?: boolean;
|
|
32
33
|
disabled?: boolean;
|
|
33
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
|
+
}
|
|
34
43
|
/** https://discord.com/developers/docs/components/reference#string-select-select-option-structure */
|
|
35
44
|
export interface RawSelectOption {
|
|
36
45
|
label: string;
|
|
@@ -50,6 +59,14 @@ export interface RawTextInput {
|
|
|
50
59
|
required?: boolean;
|
|
51
60
|
value?: string;
|
|
52
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;
|
|
53
70
|
}
|
|
54
71
|
/** https://discord.com/developers/docs/components/reference#user-select-user-select-structure */
|
|
55
72
|
export interface RawUserSelect {
|
|
@@ -62,6 +79,14 @@ export interface RawUserSelect {
|
|
|
62
79
|
max_values?: number;
|
|
63
80
|
disabled?: boolean;
|
|
64
81
|
}
|
|
82
|
+
/** https://discord.com/developers/docs/components/reference#user-select-user-select-interaction-response-structure */
|
|
83
|
+
export interface RawUserSelectInteractionResponse {
|
|
84
|
+
component_type: ComponentTypes.UserSelect;
|
|
85
|
+
id: number;
|
|
86
|
+
custom_id: string;
|
|
87
|
+
resolved: RawResolvedData;
|
|
88
|
+
values: Array<snowflake>;
|
|
89
|
+
}
|
|
65
90
|
/** https://discord.com/developers/docs/components/reference#user-select-select-default-value-structure */
|
|
66
91
|
export interface RawDefaultValue {
|
|
67
92
|
id: snowflake;
|
|
@@ -78,6 +103,14 @@ export interface RawRoleSelect {
|
|
|
78
103
|
max_values?: number;
|
|
79
104
|
disabled?: boolean;
|
|
80
105
|
}
|
|
106
|
+
/** https://discord.com/developers/docs/components/reference#role-select-role-select-interaction-response-structure */
|
|
107
|
+
export interface RawRoleSelectInteractionResponse {
|
|
108
|
+
component_type: ComponentTypes.RoleSelect;
|
|
109
|
+
id: number;
|
|
110
|
+
custom_id: string;
|
|
111
|
+
resolved: RawResolvedData;
|
|
112
|
+
values: Array<snowflake>;
|
|
113
|
+
}
|
|
81
114
|
/** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-structure */
|
|
82
115
|
export interface RawMentionableSelect {
|
|
83
116
|
type: ComponentTypes.MentionableSelect;
|
|
@@ -89,6 +122,14 @@ export interface RawMentionableSelect {
|
|
|
89
122
|
max_values?: number;
|
|
90
123
|
disabled?: boolean;
|
|
91
124
|
}
|
|
125
|
+
/** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-interaction-response-structure */
|
|
126
|
+
export interface RawMentionableSelectInteractionResponse {
|
|
127
|
+
component_type: ComponentTypes.MentionableSelect;
|
|
128
|
+
id: number;
|
|
129
|
+
custom_id: string;
|
|
130
|
+
resolved: RawResolvedData;
|
|
131
|
+
values: Array<snowflake>;
|
|
132
|
+
}
|
|
92
133
|
/** https://discord.com/developers/docs/components/reference#channel-select-channel-select-structure */
|
|
93
134
|
export interface RawChannelSelect {
|
|
94
135
|
type: ComponentTypes.ChannelSelect;
|
|
@@ -101,6 +142,14 @@ export interface RawChannelSelect {
|
|
|
101
142
|
max_values?: number;
|
|
102
143
|
disabled?: boolean;
|
|
103
144
|
}
|
|
145
|
+
/** https://discord.com/developers/docs/components/reference#channel-select-channel-select-interaction-response-structure */
|
|
146
|
+
export interface RawChannelSelectInteractionResponse {
|
|
147
|
+
component_type: ComponentTypes.ChannelSelect;
|
|
148
|
+
id: number;
|
|
149
|
+
custom_id: string;
|
|
150
|
+
resolved: RawResolvedData;
|
|
151
|
+
values: Array<snowflake>;
|
|
152
|
+
}
|
|
104
153
|
/** https://discord.com/developers/docs/components/reference#section-section-structure */
|
|
105
154
|
export interface RawSection {
|
|
106
155
|
type: ComponentTypes.Section;
|
|
@@ -177,7 +226,7 @@ export interface RawUnfurledMediaItem {
|
|
|
177
226
|
}
|
|
178
227
|
export interface ActionRow {
|
|
179
228
|
type: ComponentTypes.ActionRow;
|
|
180
|
-
components: Array<Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
|
|
229
|
+
components: Array<Button | StringSelect | TextInput | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
|
|
181
230
|
id?: number;
|
|
182
231
|
}
|
|
183
232
|
export interface Button {
|
|
@@ -202,6 +251,13 @@ export interface StringSelect {
|
|
|
202
251
|
required?: boolean;
|
|
203
252
|
disabled?: boolean;
|
|
204
253
|
}
|
|
254
|
+
export interface StringSelectInteractionResponse {
|
|
255
|
+
type: ComponentTypes.StringSelect;
|
|
256
|
+
componentType: ComponentTypes.StringSelect;
|
|
257
|
+
id: number;
|
|
258
|
+
customID: string;
|
|
259
|
+
values: Array<string>;
|
|
260
|
+
}
|
|
205
261
|
export interface SelectOption {
|
|
206
262
|
label: string;
|
|
207
263
|
value: string;
|
|
@@ -219,6 +275,13 @@ export interface TextInput {
|
|
|
219
275
|
required?: boolean;
|
|
220
276
|
value?: string;
|
|
221
277
|
placeholder?: string;
|
|
278
|
+
label: string;
|
|
279
|
+
}
|
|
280
|
+
export interface TextInputInteractionResponse {
|
|
281
|
+
type: ComponentTypes.TextInput;
|
|
282
|
+
id: number;
|
|
283
|
+
customID: string;
|
|
284
|
+
value: string;
|
|
222
285
|
}
|
|
223
286
|
export interface UserSelect {
|
|
224
287
|
type: ComponentTypes.UserSelect;
|
|
@@ -230,6 +293,13 @@ export interface UserSelect {
|
|
|
230
293
|
maxValues?: number;
|
|
231
294
|
disabled?: boolean;
|
|
232
295
|
}
|
|
296
|
+
export interface UserSelectInteractionResponse {
|
|
297
|
+
component_type: ComponentTypes.UserSelect;
|
|
298
|
+
id: number;
|
|
299
|
+
customID: string;
|
|
300
|
+
resolved: ResolvedData;
|
|
301
|
+
values: Array<snowflake>;
|
|
302
|
+
}
|
|
233
303
|
export interface DefaultValue {
|
|
234
304
|
id: snowflake;
|
|
235
305
|
type: "user" | "role" | "channel";
|
|
@@ -244,6 +314,13 @@ export interface RoleSelect {
|
|
|
244
314
|
maxValues?: number;
|
|
245
315
|
disabled?: boolean;
|
|
246
316
|
}
|
|
317
|
+
export interface RoleSelectInteractionResponse {
|
|
318
|
+
componentType: ComponentTypes.RoleSelect;
|
|
319
|
+
id: number;
|
|
320
|
+
customID: string;
|
|
321
|
+
resolved: ResolvedData;
|
|
322
|
+
values: Array<snowflake>;
|
|
323
|
+
}
|
|
247
324
|
export interface MentionableSelect {
|
|
248
325
|
type: ComponentTypes.MentionableSelect;
|
|
249
326
|
id?: number;
|
|
@@ -254,6 +331,13 @@ export interface MentionableSelect {
|
|
|
254
331
|
maxValues?: number;
|
|
255
332
|
disabled?: boolean;
|
|
256
333
|
}
|
|
334
|
+
export interface MentionableSelectInteractionResponse {
|
|
335
|
+
componentType: ComponentTypes.MentionableSelect;
|
|
336
|
+
id: number;
|
|
337
|
+
customID: string;
|
|
338
|
+
resolved: ResolvedData;
|
|
339
|
+
values: Array<snowflake>;
|
|
340
|
+
}
|
|
257
341
|
export interface ChannelSelect {
|
|
258
342
|
type: ComponentTypes.ChannelSelect;
|
|
259
343
|
id?: number;
|
|
@@ -265,6 +349,13 @@ export interface ChannelSelect {
|
|
|
265
349
|
maxValues?: number;
|
|
266
350
|
disabled?: boolean;
|
|
267
351
|
}
|
|
352
|
+
export interface ChannelSelectInteractionResponse {
|
|
353
|
+
componentType: ComponentTypes.ChannelSelect;
|
|
354
|
+
id: number;
|
|
355
|
+
customID: string;
|
|
356
|
+
resolved: ResolvedData;
|
|
357
|
+
values: Array<snowflake>;
|
|
358
|
+
}
|
|
268
359
|
export interface Section {
|
|
269
360
|
type: ComponentTypes.Section;
|
|
270
361
|
id?: number;
|