disgroove 2.2.7-dev.4cca8cf → 2.2.7-dev.8886fa2
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 +12 -10
- package/dist/lib/Client.js +28 -2
- package/dist/lib/constants.d.ts +24 -21
- package/dist/lib/constants.js +26 -23
- package/dist/lib/gateway/Shard.js +14 -0
- package/dist/lib/transformers/Components.d.ts +13 -3
- package/dist/lib/transformers/Components.js +238 -135
- package/dist/lib/transformers/Interactions.js +32 -38
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +20 -34
- package/dist/lib/types/gateway-events.d.ts +20 -0
- package/dist/lib/types/interaction.d.ts +6 -12
- package/dist/lib/types/message-components.d.ts +221 -122
- package/dist/lib/types/message.d.ts +2 -4
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -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, RawTextDisplay, Section, Separator, TextDisplay } 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";
|
|
@@ -54,10 +54,7 @@ export interface RawMessageComponentData {
|
|
|
54
54
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */
|
|
55
55
|
export interface RawModalSubmitData {
|
|
56
56
|
custom_id: string;
|
|
57
|
-
components: Array<
|
|
58
|
-
type: ComponentTypes.ActionRow;
|
|
59
|
-
components: Array<RawTextInput>;
|
|
60
|
-
}>;
|
|
57
|
+
components: Array<RawActionRow | RawTextDisplay | RawLabel>;
|
|
61
58
|
}
|
|
62
59
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
63
60
|
export interface RawResolvedData {
|
|
@@ -96,7 +93,7 @@ export interface RawInteractionCallbackData {
|
|
|
96
93
|
embeds?: Array<RawEmbed>;
|
|
97
94
|
allowed_mentions?: RawAllowedMentions;
|
|
98
95
|
flags?: MessageFlags;
|
|
99
|
-
components?: Array<
|
|
96
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
100
97
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
101
98
|
poll?: RawPollCreateParams;
|
|
102
99
|
files?: Array<FileData>;
|
|
@@ -168,10 +165,7 @@ export interface MessageComponentData {
|
|
|
168
165
|
}
|
|
169
166
|
export interface ModalSubmitData {
|
|
170
167
|
customID: string;
|
|
171
|
-
components: Array<
|
|
172
|
-
type: ComponentTypes.ActionRow;
|
|
173
|
-
components: Array<TextInput>;
|
|
174
|
-
}>;
|
|
168
|
+
components: Array<ActionRow | TextDisplay | Label>;
|
|
175
169
|
}
|
|
176
170
|
export interface ResolvedData {
|
|
177
171
|
users?: Record<snowflake, User>;
|
|
@@ -205,7 +199,7 @@ export interface InteractionCallbackData {
|
|
|
205
199
|
embeds?: Array<Embed>;
|
|
206
200
|
allowedMentions?: AllowedMentions;
|
|
207
201
|
flags?: MessageFlags;
|
|
208
|
-
components?: Array<
|
|
202
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
209
203
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
210
204
|
poll?: PollCreateParams;
|
|
211
205
|
files?: Array<FileData>;
|
|
@@ -1,81 +1,113 @@
|
|
|
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
|
+
/** https://discord.com/developers/docs/components/reference#action-row-action-row-structure */
|
|
5
|
+
export interface RawActionRow {
|
|
6
|
+
type: ComponentTypes.ActionRow;
|
|
7
|
+
components: Array<RawButton | RawStringSelect | RawTextInput | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
|
|
8
|
+
id?: number;
|
|
9
|
+
}
|
|
4
10
|
/** https://discord.com/developers/docs/components/reference#button-button-structure */
|
|
5
11
|
export interface RawButton {
|
|
6
12
|
type: ComponentTypes.Button;
|
|
13
|
+
id?: number;
|
|
7
14
|
style: ButtonStyles;
|
|
8
15
|
label?: string;
|
|
9
16
|
emoji?: Pick<RawEmoji, "name" | "id" | "animated">;
|
|
10
|
-
custom_id
|
|
17
|
+
custom_id: string;
|
|
11
18
|
sku_id?: snowflake;
|
|
12
19
|
url?: string;
|
|
13
20
|
disabled?: boolean;
|
|
14
|
-
id?: number;
|
|
15
21
|
}
|
|
16
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
17
|
-
export interface
|
|
18
|
-
type: ComponentTypes.
|
|
22
|
+
/** https://discord.com/developers/docs/components/reference#string-select-string-select-structure */
|
|
23
|
+
export interface RawStringSelect {
|
|
24
|
+
type: ComponentTypes.StringSelect;
|
|
19
25
|
id?: number;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
custom_id: string;
|
|
27
|
+
options: Array<RawSelectOption>;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
min_values?: number;
|
|
30
|
+
max_values?: number;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
23
33
|
}
|
|
24
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
25
|
-
export interface
|
|
26
|
-
|
|
34
|
+
/** https://discord.com/developers/docs/components/reference#string-select-select-option-structure */
|
|
35
|
+
export interface RawSelectOption {
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
emoji?: Pick<RawEmoji, "name" | "id" | "animated">;
|
|
40
|
+
default?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-structure */
|
|
43
|
+
export interface RawTextInput {
|
|
44
|
+
type: ComponentTypes.TextInput;
|
|
27
45
|
id?: number;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
custom_id: string;
|
|
47
|
+
style: TextInputStyles;
|
|
48
|
+
min_length?: number;
|
|
49
|
+
max_length?: number;
|
|
50
|
+
required?: boolean;
|
|
51
|
+
value?: string;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
label: string;
|
|
32
54
|
}
|
|
33
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
34
|
-
export interface
|
|
35
|
-
type: ComponentTypes.
|
|
55
|
+
/** https://discord.com/developers/docs/components/reference#user-select-user-select-structure */
|
|
56
|
+
export interface RawUserSelect {
|
|
57
|
+
type: ComponentTypes.UserSelect;
|
|
36
58
|
id?: number;
|
|
37
|
-
|
|
59
|
+
custom_id: string;
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
default_values?: Array<RawDefaultValue>;
|
|
62
|
+
min_values?: number;
|
|
63
|
+
max_values?: number;
|
|
64
|
+
disabled?: boolean;
|
|
38
65
|
}
|
|
39
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
40
|
-
export interface
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
spoiler?: boolean;
|
|
66
|
+
/** https://discord.com/developers/docs/components/reference#user-select-select-default-value-structure */
|
|
67
|
+
export interface RawDefaultValue {
|
|
68
|
+
id: snowflake;
|
|
69
|
+
type: "user" | "role" | "channel";
|
|
44
70
|
}
|
|
45
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
46
|
-
export interface
|
|
47
|
-
type: ComponentTypes.
|
|
71
|
+
/** https://discord.com/developers/docs/components/reference#role-select-role-select-structure */
|
|
72
|
+
export interface RawRoleSelect {
|
|
73
|
+
type: ComponentTypes.RoleSelect;
|
|
48
74
|
id?: number;
|
|
49
|
-
components: Array<RawTextDisplay>;
|
|
50
|
-
accessory: RawThumbnail | RawButton;
|
|
51
|
-
}
|
|
52
|
-
/** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure */
|
|
53
|
-
export interface RawSelectMenu {
|
|
54
|
-
type: ComponentTypes.ChannelSelect | ComponentTypes.MentionableSelect | ComponentTypes.RoleSelect | ComponentTypes.StringSelect | ComponentTypes.UserSelect;
|
|
55
75
|
custom_id: string;
|
|
56
|
-
options?: Array<RawSelectOption>;
|
|
57
|
-
channel_types?: Array<ChannelTypes>;
|
|
58
76
|
placeholder?: string;
|
|
59
77
|
default_values?: Array<RawDefaultValue>;
|
|
60
78
|
min_values?: number;
|
|
61
79
|
max_values?: number;
|
|
62
80
|
disabled?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-structure */
|
|
83
|
+
export interface RawMentionableSelect {
|
|
84
|
+
type: ComponentTypes.MentionableSelect;
|
|
63
85
|
id?: number;
|
|
86
|
+
custom_id: string;
|
|
87
|
+
placeholder?: string;
|
|
88
|
+
default_values?: Array<RawDefaultValue>;
|
|
89
|
+
min_values?: number;
|
|
90
|
+
max_values?: number;
|
|
91
|
+
disabled?: boolean;
|
|
64
92
|
}
|
|
65
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
66
|
-
export interface
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
93
|
+
/** https://discord.com/developers/docs/components/reference#channel-select-channel-select-structure */
|
|
94
|
+
export interface RawChannelSelect {
|
|
95
|
+
type: ComponentTypes.ChannelSelect;
|
|
96
|
+
id?: number;
|
|
97
|
+
custom_id: string;
|
|
98
|
+
channel_types?: Array<ChannelTypes>;
|
|
99
|
+
placeholder?: string;
|
|
100
|
+
default_values?: Array<RawDefaultValue>;
|
|
101
|
+
min_values?: number;
|
|
102
|
+
max_values?: number;
|
|
103
|
+
disabled?: boolean;
|
|
72
104
|
}
|
|
73
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
74
|
-
export interface
|
|
75
|
-
type: ComponentTypes.
|
|
105
|
+
/** https://discord.com/developers/docs/components/reference#section-section-structure */
|
|
106
|
+
export interface RawSection {
|
|
107
|
+
type: ComponentTypes.Section;
|
|
76
108
|
id?: number;
|
|
77
|
-
|
|
78
|
-
|
|
109
|
+
components: Array<RawTextDisplay>;
|
|
110
|
+
accessory: RawButton | RawThumbnail;
|
|
79
111
|
}
|
|
80
112
|
/** https://discord.com/developers/docs/components/reference#text-display-text-display-structure */
|
|
81
113
|
export interface RawTextDisplay {
|
|
@@ -91,31 +123,51 @@ export interface RawThumbnail {
|
|
|
91
123
|
description?: string;
|
|
92
124
|
spoiler?: boolean;
|
|
93
125
|
}
|
|
94
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
95
|
-
export interface
|
|
96
|
-
|
|
97
|
-
|
|
126
|
+
/** https://discord.com/developers/docs/components/reference#media-gallery-media-gallery-structure */
|
|
127
|
+
export interface RawMediaGallery {
|
|
128
|
+
type: ComponentTypes.MediaGallery;
|
|
129
|
+
id?: number;
|
|
130
|
+
items: Array<RawMediaGalleryItem>;
|
|
98
131
|
}
|
|
99
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
100
|
-
export interface
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
value?: string;
|
|
109
|
-
placeholder?: string;
|
|
132
|
+
/** https://discord.com/developers/docs/components/reference#media-gallery-media-gallery-item-structure */
|
|
133
|
+
export interface RawMediaGalleryItem {
|
|
134
|
+
media: RawUnfurledMediaItem;
|
|
135
|
+
description?: string;
|
|
136
|
+
spoiler?: boolean;
|
|
137
|
+
}
|
|
138
|
+
/** https://discord.com/developers/docs/components/reference#file-file-structure */
|
|
139
|
+
export interface RawFile {
|
|
140
|
+
type: ComponentTypes.File;
|
|
110
141
|
id?: number;
|
|
142
|
+
file: RawUnfurledMediaItem;
|
|
143
|
+
spoiler?: boolean;
|
|
144
|
+
name: string;
|
|
145
|
+
size: number;
|
|
111
146
|
}
|
|
112
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
113
|
-
export interface
|
|
114
|
-
type: ComponentTypes.
|
|
115
|
-
|
|
147
|
+
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
|
148
|
+
export interface RawSeparator {
|
|
149
|
+
type: ComponentTypes.Separator;
|
|
150
|
+
id?: number;
|
|
151
|
+
divider?: boolean;
|
|
152
|
+
spacing?: SeparatorSpacing;
|
|
153
|
+
}
|
|
154
|
+
/** https://discord.com/developers/docs/components/reference#container-container-structure */
|
|
155
|
+
export interface RawContainer {
|
|
156
|
+
type: ComponentTypes.Container;
|
|
116
157
|
id?: number;
|
|
158
|
+
components: Array<RawActionRow | RawTextDisplay | RawSection | RawMediaGallery | RawSeparator | RawFile>;
|
|
159
|
+
accent_color?: number | null;
|
|
160
|
+
spoiler?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** https://discord.com/developers/docs/components/reference#label-label-structure */
|
|
163
|
+
export interface RawLabel {
|
|
164
|
+
type: ComponentTypes.Label;
|
|
165
|
+
id?: number;
|
|
166
|
+
label: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
component: RawTextInput | RawStringSelect;
|
|
117
169
|
}
|
|
118
|
-
/** https://discord.com/developers/docs/components/reference#unfurled-media-item-structure */
|
|
170
|
+
/** https://discord.com/developers/docs/components/reference#unfurled-media-item-unfurled-media-item-structure */
|
|
119
171
|
export interface RawUnfurledMediaItem {
|
|
120
172
|
url: string;
|
|
121
173
|
proxy_url?: string;
|
|
@@ -124,72 +176,102 @@ export interface RawUnfurledMediaItem {
|
|
|
124
176
|
content_type?: string;
|
|
125
177
|
attachment_id?: snowflake;
|
|
126
178
|
}
|
|
179
|
+
export interface ActionRow {
|
|
180
|
+
type: ComponentTypes.ActionRow;
|
|
181
|
+
components: Array<Button | StringSelect | TextInput | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
|
|
182
|
+
id?: number;
|
|
183
|
+
}
|
|
127
184
|
export interface Button {
|
|
128
185
|
type: ComponentTypes.Button;
|
|
186
|
+
id?: number;
|
|
129
187
|
style: ButtonStyles;
|
|
130
188
|
label?: string;
|
|
131
189
|
emoji?: Pick<Emoji, "name" | "id" | "animated">;
|
|
132
|
-
customID
|
|
190
|
+
customID: string;
|
|
133
191
|
skuID?: snowflake;
|
|
134
192
|
url?: string;
|
|
135
193
|
disabled?: boolean;
|
|
136
|
-
id?: number;
|
|
137
194
|
}
|
|
138
|
-
export interface
|
|
139
|
-
type: ComponentTypes.
|
|
195
|
+
export interface StringSelect {
|
|
196
|
+
type: ComponentTypes.StringSelect;
|
|
140
197
|
id?: number;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
198
|
+
customID: string;
|
|
199
|
+
options: Array<SelectOption>;
|
|
200
|
+
placeholder?: string;
|
|
201
|
+
minValues?: number;
|
|
202
|
+
maxValues?: number;
|
|
203
|
+
required?: boolean;
|
|
204
|
+
disabled?: boolean;
|
|
144
205
|
}
|
|
145
|
-
export interface
|
|
146
|
-
|
|
206
|
+
export interface SelectOption {
|
|
207
|
+
label: string;
|
|
208
|
+
value: string;
|
|
209
|
+
description?: string;
|
|
210
|
+
emoji?: Pick<Emoji, "name" | "id" | "animated">;
|
|
211
|
+
default?: boolean;
|
|
212
|
+
}
|
|
213
|
+
export interface TextInput {
|
|
214
|
+
type: ComponentTypes.TextInput;
|
|
147
215
|
id?: number;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
216
|
+
customID: string;
|
|
217
|
+
style: TextInputStyles;
|
|
218
|
+
minLength?: number;
|
|
219
|
+
maxLength?: number;
|
|
220
|
+
required?: boolean;
|
|
221
|
+
value?: string;
|
|
222
|
+
placeholder?: string;
|
|
223
|
+
label: string;
|
|
152
224
|
}
|
|
153
|
-
export interface
|
|
154
|
-
type: ComponentTypes.
|
|
225
|
+
export interface UserSelect {
|
|
226
|
+
type: ComponentTypes.UserSelect;
|
|
155
227
|
id?: number;
|
|
156
|
-
|
|
228
|
+
customID: string;
|
|
229
|
+
placeholder?: string;
|
|
230
|
+
defaultValues?: Array<DefaultValue>;
|
|
231
|
+
minValues?: number;
|
|
232
|
+
maxValues?: number;
|
|
233
|
+
disabled?: boolean;
|
|
157
234
|
}
|
|
158
|
-
export interface
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
spoiler?: boolean;
|
|
235
|
+
export interface DefaultValue {
|
|
236
|
+
id: snowflake;
|
|
237
|
+
type: "user" | "role" | "channel";
|
|
162
238
|
}
|
|
163
|
-
export interface
|
|
164
|
-
type: ComponentTypes.
|
|
239
|
+
export interface RoleSelect {
|
|
240
|
+
type: ComponentTypes.RoleSelect;
|
|
165
241
|
id?: number;
|
|
166
|
-
components: Array<TextDisplay>;
|
|
167
|
-
accessory: Thumbnail | Button;
|
|
168
|
-
}
|
|
169
|
-
export interface SelectMenu {
|
|
170
|
-
type: ComponentTypes.ChannelSelect | ComponentTypes.MentionableSelect | ComponentTypes.RoleSelect | ComponentTypes.StringSelect | ComponentTypes.UserSelect;
|
|
171
242
|
customID: string;
|
|
172
|
-
options?: Array<SelectOption>;
|
|
173
|
-
channelTypes?: Array<ChannelTypes>;
|
|
174
243
|
placeholder?: string;
|
|
175
244
|
defaultValues?: Array<DefaultValue>;
|
|
176
245
|
minValues?: number;
|
|
177
246
|
maxValues?: number;
|
|
178
247
|
disabled?: boolean;
|
|
248
|
+
}
|
|
249
|
+
export interface MentionableSelect {
|
|
250
|
+
type: ComponentTypes.MentionableSelect;
|
|
179
251
|
id?: number;
|
|
252
|
+
customID: string;
|
|
253
|
+
placeholder?: string;
|
|
254
|
+
defaultValues?: Array<DefaultValue>;
|
|
255
|
+
minValues?: number;
|
|
256
|
+
maxValues?: number;
|
|
257
|
+
disabled?: boolean;
|
|
180
258
|
}
|
|
181
|
-
export interface
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
259
|
+
export interface ChannelSelect {
|
|
260
|
+
type: ComponentTypes.ChannelSelect;
|
|
261
|
+
id?: number;
|
|
262
|
+
customID: string;
|
|
263
|
+
channelTypes?: Array<ChannelTypes>;
|
|
264
|
+
placeholder?: string;
|
|
265
|
+
defaultValues?: Array<DefaultValue>;
|
|
266
|
+
minValues?: number;
|
|
267
|
+
maxValues?: number;
|
|
268
|
+
disabled?: boolean;
|
|
187
269
|
}
|
|
188
|
-
export interface
|
|
189
|
-
type: ComponentTypes.
|
|
270
|
+
export interface Section {
|
|
271
|
+
type: ComponentTypes.Section;
|
|
190
272
|
id?: number;
|
|
191
|
-
|
|
192
|
-
|
|
273
|
+
components: Array<TextDisplay>;
|
|
274
|
+
accessory: Button | Thumbnail;
|
|
193
275
|
}
|
|
194
276
|
export interface TextDisplay {
|
|
195
277
|
type: ComponentTypes.TextDisplay;
|
|
@@ -203,26 +285,43 @@ export interface Thumbnail {
|
|
|
203
285
|
description?: string;
|
|
204
286
|
spoiler?: boolean;
|
|
205
287
|
}
|
|
206
|
-
export interface
|
|
207
|
-
|
|
208
|
-
|
|
288
|
+
export interface MediaGallery {
|
|
289
|
+
type: ComponentTypes.MediaGallery;
|
|
290
|
+
id?: number;
|
|
291
|
+
items: Array<MediaGalleryItem>;
|
|
209
292
|
}
|
|
210
|
-
export interface
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
required?: boolean;
|
|
218
|
-
value?: string;
|
|
219
|
-
placeholder?: string;
|
|
293
|
+
export interface MediaGalleryItem {
|
|
294
|
+
media: UnfurledMediaItem;
|
|
295
|
+
description?: string;
|
|
296
|
+
spoiler?: boolean;
|
|
297
|
+
}
|
|
298
|
+
export interface File {
|
|
299
|
+
type: ComponentTypes.File;
|
|
220
300
|
id?: number;
|
|
301
|
+
file: UnfurledMediaItem;
|
|
302
|
+
spoiler?: boolean;
|
|
303
|
+
name: string;
|
|
304
|
+
size: number;
|
|
221
305
|
}
|
|
222
|
-
export interface
|
|
223
|
-
type: ComponentTypes.
|
|
224
|
-
components: Array<Button | SelectMenu | TextInput>;
|
|
306
|
+
export interface Separator {
|
|
307
|
+
type: ComponentTypes.Separator;
|
|
225
308
|
id?: number;
|
|
309
|
+
divider?: boolean;
|
|
310
|
+
spacing?: SeparatorSpacing;
|
|
311
|
+
}
|
|
312
|
+
export interface Container {
|
|
313
|
+
type: ComponentTypes.Container;
|
|
314
|
+
id?: number;
|
|
315
|
+
components: Array<ActionRow | TextDisplay | Section | MediaGallery | Separator | File>;
|
|
316
|
+
accentColor?: number | null;
|
|
317
|
+
spoiler?: boolean;
|
|
318
|
+
}
|
|
319
|
+
export interface Label {
|
|
320
|
+
type: ComponentTypes.Label;
|
|
321
|
+
id?: number;
|
|
322
|
+
label: string;
|
|
323
|
+
description?: string;
|
|
324
|
+
component: TextInput | StringSelect;
|
|
226
325
|
}
|
|
227
326
|
export interface UnfurledMediaItem {
|
|
228
327
|
url: string;
|
|
@@ -38,7 +38,7 @@ export interface RawMessage {
|
|
|
38
38
|
interaction_metadata?: RawMessageInteractionMetadata;
|
|
39
39
|
interaction?: RawMessageInteraction;
|
|
40
40
|
thread?: RawChannel;
|
|
41
|
-
components?: Array<
|
|
41
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer>;
|
|
42
42
|
sticker_items?: Array<RawStickerItem>;
|
|
43
43
|
stickers?: Array<RawSticker>;
|
|
44
44
|
position?: number;
|
|
@@ -47,7 +47,6 @@ export interface RawMessage {
|
|
|
47
47
|
poll?: RawPoll;
|
|
48
48
|
call?: RawMessageCall;
|
|
49
49
|
}
|
|
50
|
-
export type RawMessageTopLevelComponent = RawActionRow | RawTextDisplay | RawContainer | RawFile | RawSection | RawSeparator | RawMediaGallery;
|
|
51
50
|
/** https://discord.com/developers/docs/resources/message#message-object-message-activity-structure */
|
|
52
51
|
export interface RawMessageActivity {
|
|
53
52
|
type: MessageActivityTypes;
|
|
@@ -231,7 +230,7 @@ export interface Message {
|
|
|
231
230
|
interactionMetadata?: MessageInteractionMetadata;
|
|
232
231
|
interaction?: MessageInteraction;
|
|
233
232
|
thread?: Channel;
|
|
234
|
-
components?: Array<
|
|
233
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
235
234
|
stickerItems?: Array<StickerItem>;
|
|
236
235
|
stickers?: Array<Sticker>;
|
|
237
236
|
position?: number;
|
|
@@ -240,7 +239,6 @@ export interface Message {
|
|
|
240
239
|
poll?: Poll;
|
|
241
240
|
call?: MessageCall;
|
|
242
241
|
}
|
|
243
|
-
export type MessageTopLevelComponent = ActionRow | TextDisplay | Container | File | Section | Separator | MediaGallery;
|
|
244
242
|
export interface MessageActivity {
|
|
245
243
|
type: MessageActivityTypes;
|
|
246
244
|
partyID?: string;
|
package/dist/package.json
CHANGED