disgroove 2.2.7-dev.4cca8cf → 2.2.7-dev.5357ecd
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 +45 -11
- package/dist/lib/Client.js +88 -2
- package/dist/lib/constants.d.ts +28 -21
- package/dist/lib/constants.js +32 -24
- package/dist/lib/gateway/Shard.js +14 -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 +13 -3
- package/dist/lib/transformers/Components.js +238 -135
- package/dist/lib/transformers/Interactions.js +130 -38
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +20 -34
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/gateway-events.d.ts +20 -0
- package/dist/lib/types/guild.d.ts +7 -5
- package/dist/lib/types/interaction.d.ts +14 -8
- 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 +306 -118
- package/dist/lib/types/message.d.ts +2 -4
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@ 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");
|
|
11
|
+
const Components_1 = require("./Components");
|
|
10
12
|
class Interactions {
|
|
11
13
|
static interactionCallbackResponseFromRaw(interactionCallbackResponse) {
|
|
12
14
|
return {
|
|
@@ -57,32 +59,76 @@ class Interactions {
|
|
|
57
59
|
type: interaction.type,
|
|
58
60
|
data: interaction.data !== undefined
|
|
59
61
|
? {
|
|
60
|
-
id: interaction.data
|
|
61
|
-
name: interaction.data
|
|
62
|
-
type: interaction.data
|
|
63
|
-
resolved: interaction.data
|
|
62
|
+
id: interaction.data?.id,
|
|
63
|
+
name: interaction.data?.name,
|
|
64
|
+
type: interaction.data?.type,
|
|
65
|
+
resolved: interaction.data?.resolved !== undefined
|
|
64
66
|
? Interactions.resolvedDataFromRaw(interaction.data.resolved)
|
|
65
67
|
: undefined,
|
|
66
|
-
options: interaction.data
|
|
67
|
-
guildID: interaction.data
|
|
68
|
-
targetID: interaction.data
|
|
69
|
-
customID: interaction.data
|
|
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
|
-
|
|
68
|
+
options: interaction.data?.options,
|
|
69
|
+
guildID: interaction.data?.guild_id,
|
|
70
|
+
targetID: interaction.data?.target_id,
|
|
71
|
+
customID: interaction.data?.custom_id,
|
|
72
|
+
componentType: interaction.data?.component_type,
|
|
73
|
+
values: interaction.data?.values,
|
|
74
|
+
components: interaction.data?.components?.map((component) => {
|
|
75
|
+
switch (component.type) {
|
|
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
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
86
132
|
}
|
|
87
133
|
: undefined,
|
|
88
134
|
guild: interaction.guild !== undefined
|
|
@@ -117,6 +163,7 @@ class Interactions {
|
|
|
117
163
|
"1": interaction.authorizing_integration_owners[1],
|
|
118
164
|
},
|
|
119
165
|
context: interaction.context,
|
|
166
|
+
attachmentSizeLimit: interaction.attachment_size_limit,
|
|
120
167
|
};
|
|
121
168
|
}
|
|
122
169
|
static interactionMetadataFromRaw(interactionMetadata) {
|
|
@@ -170,20 +217,64 @@ class Interactions {
|
|
|
170
217
|
custom_id: interaction.data.customID,
|
|
171
218
|
component_type: interaction.data.componentType,
|
|
172
219
|
values: interaction.data.values,
|
|
173
|
-
components: interaction.data
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
220
|
+
components: interaction.data?.components?.map((component) => {
|
|
221
|
+
switch (component.type) {
|
|
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
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}),
|
|
187
278
|
}
|
|
188
279
|
: undefined,
|
|
189
280
|
guild: interaction.guild !== undefined
|
|
@@ -218,6 +309,7 @@ class Interactions {
|
|
|
218
309
|
"1": interaction.authorizingIntegrationOwners[1],
|
|
219
310
|
},
|
|
220
311
|
context: interaction.context,
|
|
312
|
+
attachment_size_limit: interaction.attachmentSizeLimit,
|
|
221
313
|
};
|
|
222
314
|
}
|
|
223
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,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/message-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;
|
|
@@ -51,54 +51,40 @@ class Messages {
|
|
|
51
51
|
static componentsFromRaw(components) {
|
|
52
52
|
return components.map((component) => {
|
|
53
53
|
switch (component.type) {
|
|
54
|
-
case constants_1.ComponentTypes.ActionRow:
|
|
54
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
55
55
|
return Components_js_1.Components.actionRowFromRaw(component);
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
case constants_1.ComponentTypes.Section:
|
|
57
|
+
return Components_js_1.Components.sectionFromRaw(component);
|
|
58
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
58
59
|
return Components_js_1.Components.textDisplayFromRaw(component);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
case constants_1.ComponentTypes.File: {
|
|
60
|
+
case constants_1.ComponentTypes.MediaGallery:
|
|
61
|
+
return Components_js_1.Components.mediaGalleryFromRaw(component);
|
|
62
|
+
case constants_1.ComponentTypes.File:
|
|
64
63
|
return Components_js_1.Components.fileFromRaw(component);
|
|
65
|
-
|
|
66
|
-
case constants_1.ComponentTypes.Section: {
|
|
67
|
-
return Components_js_1.Components.sectionFromRaw(component);
|
|
68
|
-
}
|
|
69
|
-
case constants_1.ComponentTypes.Separator: {
|
|
64
|
+
case constants_1.ComponentTypes.Separator:
|
|
70
65
|
return Components_js_1.Components.separatorFromRaw(component);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return Components_js_1.Components.mediaGalleryFromRaw(component);
|
|
74
|
-
}
|
|
66
|
+
case constants_1.ComponentTypes.Container:
|
|
67
|
+
return Components_js_1.Components.containerFromRaw(component);
|
|
75
68
|
}
|
|
76
69
|
});
|
|
77
70
|
}
|
|
78
71
|
static componentsToRaw(components) {
|
|
79
72
|
return components.map((component) => {
|
|
80
73
|
switch (component.type) {
|
|
81
|
-
case constants_1.ComponentTypes.ActionRow:
|
|
74
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
82
75
|
return Components_js_1.Components.actionRowToRaw(component);
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
case constants_1.ComponentTypes.Section:
|
|
77
|
+
return Components_js_1.Components.sectionToRaw(component);
|
|
78
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
85
79
|
return Components_js_1.Components.textDisplayToRaw(component);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
case constants_1.ComponentTypes.File: {
|
|
80
|
+
case constants_1.ComponentTypes.MediaGallery:
|
|
81
|
+
return Components_js_1.Components.mediaGalleryToRaw(component);
|
|
82
|
+
case constants_1.ComponentTypes.File:
|
|
91
83
|
return Components_js_1.Components.fileToRaw(component);
|
|
92
|
-
|
|
93
|
-
case constants_1.ComponentTypes.Section: {
|
|
94
|
-
return Components_js_1.Components.sectionToRaw(component);
|
|
95
|
-
}
|
|
96
|
-
case constants_1.ComponentTypes.Separator: {
|
|
84
|
+
case constants_1.ComponentTypes.Separator:
|
|
97
85
|
return Components_js_1.Components.separatorToRaw(component);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return Components_js_1.Components.mediaGalleryToRaw(component);
|
|
101
|
-
}
|
|
86
|
+
case constants_1.ComponentTypes.Container:
|
|
87
|
+
return Components_js_1.Components.containerToRaw(component);
|
|
102
88
|
}
|
|
103
89
|
});
|
|
104
90
|
}
|
|
@@ -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);
|
|
@@ -375,6 +375,17 @@ export interface RawMessagePollVoteRemoveFields {
|
|
|
375
375
|
guild_id?: snowflake;
|
|
376
376
|
answer_id: number;
|
|
377
377
|
}
|
|
378
|
+
/** https://discord.com/developers/docs/events/gateway-events#rate-limited-rate-limited-fields */
|
|
379
|
+
export interface RawRateLimitedFields {
|
|
380
|
+
opcode: GatewayOPCodes;
|
|
381
|
+
retry_after: number;
|
|
382
|
+
meta: RawRequestGuildMembersRateLimitMetadata;
|
|
383
|
+
}
|
|
384
|
+
/** https://discord.com/developers/docs/events/gateway-events#rate-limited-rate-limit-metadata-for-opcode-structure */
|
|
385
|
+
export interface RawRequestGuildMembersRateLimitMetadata {
|
|
386
|
+
guild_id: snowflake;
|
|
387
|
+
nonce?: string;
|
|
388
|
+
}
|
|
378
389
|
export interface Payload {
|
|
379
390
|
op: GatewayOPCodes;
|
|
380
391
|
d: any | null;
|
|
@@ -691,3 +702,12 @@ export interface MessagePollVoteRemoveFields {
|
|
|
691
702
|
guildID?: snowflake;
|
|
692
703
|
answerID: number;
|
|
693
704
|
}
|
|
705
|
+
export interface RateLimitedFields {
|
|
706
|
+
opcode: GatewayOPCodes;
|
|
707
|
+
retryAfter: number;
|
|
708
|
+
meta: RequestGuildMembersRateLimitMetadata;
|
|
709
|
+
}
|
|
710
|
+
export interface RequestGuildMembersRateLimitMetadata {
|
|
711
|
+
guildID: snowflake;
|
|
712
|
+
nonce?: string;
|
|
713
|
+
}
|
|
@@ -93,13 +93,14 @@ export interface RawGuildMember {
|
|
|
93
93
|
banner?: string | null;
|
|
94
94
|
roles: Array<snowflake>;
|
|
95
95
|
joined_at: timestamp | null;
|
|
96
|
-
premium_since?:
|
|
96
|
+
premium_since?: timestamp | null;
|
|
97
97
|
deaf: boolean;
|
|
98
98
|
mute: boolean;
|
|
99
99
|
flags: GuildMemberFlags;
|
|
100
100
|
pending?: boolean;
|
|
101
101
|
permissions?: string;
|
|
102
|
-
communication_disabled_until?:
|
|
102
|
+
communication_disabled_until?: timestamp | null;
|
|
103
|
+
unusual_dm_activity_until?: timestamp | null;
|
|
103
104
|
avatar_decoration_data?: RawAvatarDecorationData | null;
|
|
104
105
|
}
|
|
105
106
|
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
|
|
@@ -269,14 +270,15 @@ export interface GuildMember {
|
|
|
269
270
|
avatar?: string | null;
|
|
270
271
|
banner?: string | null;
|
|
271
272
|
roles: Array<snowflake>;
|
|
272
|
-
joinedAt:
|
|
273
|
-
premiumSince?:
|
|
273
|
+
joinedAt: timestamp | null;
|
|
274
|
+
premiumSince?: timestamp | null;
|
|
274
275
|
deaf: boolean;
|
|
275
276
|
mute: boolean;
|
|
276
277
|
flags: GuildMemberFlags;
|
|
277
278
|
pending?: boolean;
|
|
278
279
|
permissions?: string;
|
|
279
|
-
communicationDisabledUntil?:
|
|
280
|
+
communicationDisabledUntil?: timestamp | null;
|
|
281
|
+
unusualDMActivityUntil?: timestamp | null;
|
|
280
282
|
avatarDecorationData?: AvatarDecorationData | null;
|
|
281
283
|
}
|
|
282
284
|
export interface Integration {
|
|
@@ -5,8 +5,8 @@ import type { RawChannel, Channel } from "./channel";
|
|
|
5
5
|
import type { snowflake } from "./common";
|
|
6
6
|
import type { RawEntitlement, Entitlement } from "./entitlements";
|
|
7
7
|
import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
|
|
8
|
-
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions
|
|
9
|
-
import type {
|
|
8
|
+
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
|
|
9
|
+
import type { ActionRow, 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 {
|
|
@@ -56,8 +57,10 @@ export interface RawModalSubmitData {
|
|
|
56
57
|
custom_id: string;
|
|
57
58
|
components: Array<{
|
|
58
59
|
type: ComponentTypes.ActionRow;
|
|
59
|
-
components: Array<
|
|
60
|
-
}
|
|
60
|
+
components: Array<RawStringSelectInteractionResponse | RawTextInputInteractionResponse>;
|
|
61
|
+
} | RawTextDisplay | (Omit<RawLabel, "component"> & {
|
|
62
|
+
component: RawStringSelectInteractionResponse | RawTextInputInteractionResponse;
|
|
63
|
+
})>;
|
|
61
64
|
}
|
|
62
65
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
63
66
|
export interface RawResolvedData {
|
|
@@ -96,7 +99,7 @@ export interface RawInteractionCallbackData {
|
|
|
96
99
|
embeds?: Array<RawEmbed>;
|
|
97
100
|
allowed_mentions?: RawAllowedMentions;
|
|
98
101
|
flags?: MessageFlags;
|
|
99
|
-
components?: Array<
|
|
102
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
100
103
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
101
104
|
poll?: RawPollCreateParams;
|
|
102
105
|
files?: Array<FileData>;
|
|
@@ -150,6 +153,7 @@ export interface Interaction {
|
|
|
150
153
|
entitlements: Array<Entitlement>;
|
|
151
154
|
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
|
152
155
|
context?: InteractionContextTypes;
|
|
156
|
+
attachmentSizeLimit: number;
|
|
153
157
|
}
|
|
154
158
|
export interface ApplicationCommandData {
|
|
155
159
|
id: snowflake;
|
|
@@ -170,8 +174,10 @@ export interface ModalSubmitData {
|
|
|
170
174
|
customID: string;
|
|
171
175
|
components: Array<{
|
|
172
176
|
type: ComponentTypes.ActionRow;
|
|
173
|
-
components: Array<
|
|
174
|
-
}
|
|
177
|
+
components: Array<StringSelectInteractionResponse | TextInputInteractionResponse>;
|
|
178
|
+
} | TextDisplay | (Omit<Label, "component"> & {
|
|
179
|
+
component: StringSelectInteractionResponse | TextInputInteractionResponse;
|
|
180
|
+
})>;
|
|
175
181
|
}
|
|
176
182
|
export interface ResolvedData {
|
|
177
183
|
users?: Record<snowflake, User>;
|
|
@@ -205,7 +211,7 @@ export interface InteractionCallbackData {
|
|
|
205
211
|
embeds?: Array<Embed>;
|
|
206
212
|
allowedMentions?: AllowedMentions;
|
|
207
213
|
flags?: MessageFlags;
|
|
208
|
-
components?: Array<
|
|
214
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
209
215
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
210
216
|
poll?: PollCreateParams;
|
|
211
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
|
+
}
|