seyfert 4.4.1 → 4.6.0
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/README.md +7 -1
- package/lib/api/Routes/guilds.d.ts +12 -1
- package/lib/api/Routes/index.d.ts +3 -1
- package/lib/api/Routes/invites.d.ts +1 -1
- package/lib/api/Routes/oauth2.d.ts +11 -0
- package/lib/api/Routes/oauth2.js +2 -0
- package/lib/api/Routes/skus.d.ts +11 -4
- package/lib/api/Routes/users.d.ts +2 -1
- package/lib/api/Routes/voice.d.ts +4 -0
- package/lib/api/Routes/webhooks.d.ts +1 -1
- package/lib/api/api.d.ts +15 -5
- package/lib/api/api.js +243 -114
- package/lib/api/bucket.js +13 -7
- package/lib/api/shared.d.ts +3 -1
- package/lib/api/utils/constants.d.ts +1 -1
- package/lib/api/utils/constants.js +1 -1
- package/lib/builders/Attachment.d.ts +6 -1
- package/lib/builders/Attachment.js +13 -9
- package/lib/builders/CheckboxGroup.js +1 -1
- package/lib/builders/FileUpload.d.ts +8 -1
- package/lib/builders/FileUpload.js +9 -0
- package/lib/builders/RadioGroup.js +1 -1
- package/lib/client/base.d.ts +3 -3
- package/lib/client/client.d.ts +1 -1
- package/lib/client/client.js +5 -4
- package/lib/client/collectors.d.ts +10 -8
- package/lib/client/transformers.d.ts +5 -0
- package/lib/client/workerclient.d.ts +8 -1
- package/lib/client/workerclient.js +34 -14
- package/lib/commands/applications/chat.d.ts +6 -4
- package/lib/commands/applications/options.d.ts +6 -4
- package/lib/commands/applications/shared.d.ts +2 -2
- package/lib/commands/handle.d.ts +7 -3
- package/lib/commands/handle.js +36 -11
- package/lib/commands/handler.js +11 -0
- package/lib/commands/optionresolver.d.ts +6 -7
- package/lib/common/it/error.d.ts +13 -0
- package/lib/common/it/error.js +15 -1
- package/lib/common/it/logger.js +12 -9
- package/lib/common/shorters/application.d.ts +1 -1
- package/lib/common/shorters/application.js +1 -1
- package/lib/common/shorters/bans.js +1 -1
- package/lib/common/shorters/guilds.js +5 -1
- package/lib/common/shorters/interaction.js +7 -4
- package/lib/common/shorters/invites.d.ts +5 -0
- package/lib/common/shorters/members.js +2 -1
- package/lib/common/shorters/messages.js +2 -2
- package/lib/common/shorters/threads.js +1 -1
- package/lib/common/shorters/webhook.js +3 -3
- package/lib/common/types/util.d.ts +7 -0
- package/lib/components/componentcommand.js +2 -2
- package/lib/components/customId.d.ts +3 -0
- package/lib/components/customId.js +11 -0
- package/lib/components/handler.js +2 -3
- package/lib/components/modalcommand.js +2 -2
- package/lib/events/hooks/invite.d.ts +1 -0
- package/lib/events/hooks/presence.d.ts +1 -0
- package/lib/events/hooks/thread.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/structures/AnonymousGuild.d.ts +1 -1
- package/lib/structures/AnonymousGuild.js +1 -1
- package/lib/structures/Guild.d.ts +3 -0
- package/lib/structures/GuildMember.d.ts +2 -2
- package/lib/structures/GuildMember.js +22 -4
- package/lib/structures/GuildPreview.d.ts +1 -1
- package/lib/structures/GuildPreview.js +1 -1
- package/lib/structures/GuildRole.d.ts +13 -0
- package/lib/structures/GuildRole.js +21 -0
- package/lib/structures/GuildTemplate.js +1 -1
- package/lib/structures/Interaction.d.ts +7 -7
- package/lib/structures/Interaction.js +35 -21
- package/lib/structures/Message.d.ts +2 -1
- package/lib/structures/channels.d.ts +29 -16
- package/lib/structures/channels.js +59 -19
- package/lib/structures/extra/BaseGuild.d.ts +4 -4
- package/lib/structures/extra/BaseGuild.js +4 -4
- package/lib/types/gateway.d.ts +243 -239
- package/lib/types/index.d.ts +2 -2
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.d.ts +5 -2
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.d.ts +2 -2
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.js +1 -1
- package/lib/types/payloads/_interactions/_applicationCommands/chatInput.d.ts +7 -7
- package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.d.ts +13 -13
- package/lib/types/payloads/_interactions/_applicationCommands/permissions.d.ts +4 -4
- package/lib/types/payloads/_interactions/_applicationCommands/permissions.js +2 -2
- package/lib/types/payloads/_interactions/applicationCommands.d.ts +10 -10
- package/lib/types/payloads/_interactions/applicationCommands.js +4 -4
- package/lib/types/payloads/_interactions/autocomplete.d.ts +2 -2
- package/lib/types/payloads/_interactions/base.d.ts +13 -7
- package/lib/types/payloads/_interactions/modalSubmit.d.ts +4 -4
- package/lib/types/payloads/_interactions/responses.d.ts +10 -10
- package/lib/types/payloads/_interactions/responses.js +2 -2
- package/lib/types/payloads/application.d.ts +21 -15
- package/lib/types/payloads/application.js +7 -7
- package/lib/types/payloads/auditLog.d.ts +22 -17
- package/lib/types/payloads/auditLog.js +7 -2
- package/lib/types/payloads/autoModeration.d.ts +11 -11
- package/lib/types/payloads/autoModeration.js +5 -5
- package/lib/types/payloads/channel.d.ts +87 -78
- package/lib/types/payloads/channel.js +16 -11
- package/lib/types/payloads/components.d.ts +41 -31
- package/lib/types/payloads/components.js +9 -5
- package/lib/types/payloads/emoji.d.ts +2 -2
- package/lib/types/payloads/emoji.js +1 -1
- package/lib/types/payloads/gateway.d.ts +33 -29
- package/lib/types/payloads/gateway.js +5 -5
- package/lib/types/payloads/guild.d.ts +68 -68
- package/lib/types/payloads/guild.js +14 -14
- package/lib/types/payloads/guildScheduledEvent.d.ts +11 -11
- package/lib/types/payloads/guildScheduledEvent.js +3 -3
- package/lib/types/payloads/index.d.ts +2 -2
- package/lib/types/payloads/interactions.d.ts +3 -3
- package/lib/types/payloads/invite.d.ts +11 -11
- package/lib/types/payloads/invite.js +3 -3
- package/lib/types/payloads/monetization.d.ts +4 -4
- package/lib/types/payloads/monetization.js +2 -2
- package/lib/types/payloads/oauth2.d.ts +21 -17
- package/lib/types/payloads/oauth2.js +21 -17
- package/lib/types/payloads/permissions.d.ts +5 -5
- package/lib/types/payloads/permissions.js +2 -2
- package/lib/types/payloads/poll.d.ts +7 -7
- package/lib/types/payloads/poll.js +2 -2
- package/lib/types/payloads/soundboard.d.ts +2 -2
- package/lib/types/payloads/soundboard.js +1 -1
- package/lib/types/payloads/stageInstance.d.ts +5 -5
- package/lib/types/payloads/stageInstance.js +1 -1
- package/lib/types/payloads/sticker.d.ts +8 -8
- package/lib/types/payloads/sticker.js +3 -3
- package/lib/types/payloads/teams.d.ts +8 -8
- package/lib/types/payloads/teams.js +3 -3
- package/lib/types/payloads/template.d.ts +3 -3
- package/lib/types/payloads/template.js +1 -1
- package/lib/types/payloads/user.d.ts +24 -22
- package/lib/types/payloads/user.js +7 -5
- package/lib/types/payloads/voice.d.ts +4 -4
- package/lib/types/payloads/voice.js +1 -1
- package/lib/types/payloads/webhokEvents.d.ts +5 -5
- package/lib/types/payloads/webhokEvents.js +2 -2
- package/lib/types/payloads/webhook.d.ts +4 -4
- package/lib/types/payloads/webhook.js +1 -1
- package/lib/types/rest/application.d.ts +14 -14
- package/lib/types/rest/auditLog.d.ts +1 -1
- package/lib/types/rest/autoModeration.d.ts +7 -7
- package/lib/types/rest/channel.d.ts +79 -74
- package/lib/types/rest/channel.js +1 -1
- package/lib/types/rest/emoji.d.ts +8 -8
- package/lib/types/rest/gateway.d.ts +2 -2
- package/lib/types/rest/guild.d.ts +98 -98
- package/lib/types/rest/guild.js +5 -5
- package/lib/types/rest/guildScheduledEvent.d.ts +11 -11
- package/lib/types/rest/index.d.ts +34 -3
- package/lib/types/rest/index.js +33 -2
- package/lib/types/rest/interactions.d.ts +48 -48
- package/lib/types/rest/invite.d.ts +5 -5
- package/lib/types/rest/monetization.d.ts +9 -9
- package/lib/types/rest/monetization.js +1 -1
- package/lib/types/rest/oauth2.d.ts +22 -18
- package/lib/types/rest/poll.d.ts +4 -4
- package/lib/types/rest/soundboard.d.ts +8 -8
- package/lib/types/rest/stageInstance.d.ts +6 -6
- package/lib/types/rest/sticker.d.ts +10 -10
- package/lib/types/rest/template.d.ts +11 -11
- package/lib/types/rest/user.d.ts +18 -14
- package/lib/types/rest/voice.d.ts +5 -5
- package/lib/types/rest/webhook.d.ts +38 -38
- package/lib/types/utils/index.d.ts +19 -19
- package/lib/types/utils/index.js +19 -19
- package/lib/websocket/SharedTypes.d.ts +2 -2
- package/lib/websocket/constants/index.js +2 -2
- package/lib/websocket/discord/heartbeater.d.ts +1 -0
- package/lib/websocket/discord/heartbeater.js +8 -0
- package/lib/websocket/discord/shard.d.ts +19 -10
- package/lib/websocket/discord/shard.js +255 -122
- package/lib/websocket/discord/sharder.d.ts +2 -2
- package/lib/websocket/discord/sharder.js +2 -2
- package/lib/websocket/discord/shared.d.ts +7 -2
- package/lib/websocket/discord/workermanager.d.ts +3 -1
- package/lib/websocket/discord/workermanager.js +31 -24
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Types extracted from https://discord.com/developers/
|
|
3
|
+
* Types extracted from https://docs.discord.com/developers/resources/channel
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AllowedMentionsTypes = exports.AttachmentFlags = exports.EmbedType = exports.ThreadMemberFlags = exports.ThreadAutoArchiveDuration = exports.BaseThemeType = exports.MessageFlags = exports.MessageActivityType = exports.MessageReferenceType = exports.MessageType = exports.ForumLayoutType = exports.SortOrderType = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* https://discord.com/developers/
|
|
8
|
+
* https://docs.discord.com/developers/resources/channel/#channel-object-sort-order-types
|
|
9
9
|
*/
|
|
10
10
|
var SortOrderType;
|
|
11
11
|
(function (SortOrderType) {
|
|
@@ -19,7 +19,7 @@ var SortOrderType;
|
|
|
19
19
|
SortOrderType[SortOrderType["CreationDate"] = 1] = "CreationDate";
|
|
20
20
|
})(SortOrderType || (exports.SortOrderType = SortOrderType = {}));
|
|
21
21
|
/**
|
|
22
|
-
* https://discord.com/developers/
|
|
22
|
+
* https://docs.discord.com/developers/resources/channel/#channel-object-forum-layout-types
|
|
23
23
|
*/
|
|
24
24
|
var ForumLayoutType;
|
|
25
25
|
(function (ForumLayoutType) {
|
|
@@ -37,7 +37,7 @@ var ForumLayoutType;
|
|
|
37
37
|
ForumLayoutType[ForumLayoutType["GalleryView"] = 2] = "GalleryView";
|
|
38
38
|
})(ForumLayoutType || (exports.ForumLayoutType = ForumLayoutType = {}));
|
|
39
39
|
/**
|
|
40
|
-
* https://discord.com/developers/
|
|
40
|
+
* https://docs.discord.com/developers/resources/channel#message-object-message-types
|
|
41
41
|
*/
|
|
42
42
|
var MessageType;
|
|
43
43
|
(function (MessageType) {
|
|
@@ -84,7 +84,7 @@ var MessageType;
|
|
|
84
84
|
MessageType[MessageType["PollResult"] = 46] = "PollResult";
|
|
85
85
|
})(MessageType || (exports.MessageType = MessageType = {}));
|
|
86
86
|
/**
|
|
87
|
-
* https://discord.com/developers/
|
|
87
|
+
* https://docs.discord.com/developers/resources/channel#message-reference-types
|
|
88
88
|
*/
|
|
89
89
|
var MessageReferenceType;
|
|
90
90
|
(function (MessageReferenceType) {
|
|
@@ -98,7 +98,7 @@ var MessageReferenceType;
|
|
|
98
98
|
MessageReferenceType[MessageReferenceType["Forward"] = 1] = "Forward";
|
|
99
99
|
})(MessageReferenceType || (exports.MessageReferenceType = MessageReferenceType = {}));
|
|
100
100
|
/**
|
|
101
|
-
* https://discord.com/developers/
|
|
101
|
+
* https://docs.discord.com/developers/resources/channel#message-object-message-activity-types
|
|
102
102
|
*/
|
|
103
103
|
var MessageActivityType;
|
|
104
104
|
(function (MessageActivityType) {
|
|
@@ -106,9 +106,10 @@ var MessageActivityType;
|
|
|
106
106
|
MessageActivityType[MessageActivityType["Spectate"] = 2] = "Spectate";
|
|
107
107
|
MessageActivityType[MessageActivityType["Listen"] = 3] = "Listen";
|
|
108
108
|
MessageActivityType[MessageActivityType["JoinRequest"] = 5] = "JoinRequest";
|
|
109
|
+
MessageActivityType[MessageActivityType["StreamRequest"] = 6] = "StreamRequest";
|
|
109
110
|
})(MessageActivityType || (exports.MessageActivityType = MessageActivityType = {}));
|
|
110
111
|
/**
|
|
111
|
-
* https://discord.com/developers/
|
|
112
|
+
* https://docs.discord.com/developers/resources/channel#message-object-message-flags
|
|
112
113
|
*/
|
|
113
114
|
var MessageFlags;
|
|
114
115
|
(function (MessageFlags) {
|
|
@@ -207,7 +208,7 @@ var ThreadMemberFlags;
|
|
|
207
208
|
ThreadMemberFlags[ThreadMemberFlags["NoMessages"] = 8] = "NoMessages";
|
|
208
209
|
})(ThreadMemberFlags || (exports.ThreadMemberFlags = ThreadMemberFlags = {}));
|
|
209
210
|
/**
|
|
210
|
-
* https://discord.com/developers/
|
|
211
|
+
* https://docs.discord.com/developers/resources/channel#embed-object-embed-types
|
|
211
212
|
*
|
|
212
213
|
*/
|
|
213
214
|
var EmbedType;
|
|
@@ -238,7 +239,7 @@ var EmbedType;
|
|
|
238
239
|
EmbedType["Link"] = "link";
|
|
239
240
|
/**
|
|
240
241
|
* Poll result embed
|
|
241
|
-
* https://discord.com/developers/
|
|
242
|
+
* https://docs.discord.com/developers/resources/message#embed-fields-by-embed-type-poll-result-embed-fields
|
|
242
243
|
*/
|
|
243
244
|
EmbedType["PollResult"] = "poll_result";
|
|
244
245
|
/**
|
|
@@ -249,7 +250,7 @@ var EmbedType;
|
|
|
249
250
|
EmbedType["AutoModerationMessage"] = "auto_moderation_message";
|
|
250
251
|
})(EmbedType || (exports.EmbedType = EmbedType = {}));
|
|
251
252
|
/**
|
|
252
|
-
* https://discord.com/developers/
|
|
253
|
+
* https://docs.discord.com/developers/resources/channel#attachment-object-attachment-structure-attachment-flags
|
|
253
254
|
*/
|
|
254
255
|
var AttachmentFlags;
|
|
255
256
|
(function (AttachmentFlags) {
|
|
@@ -257,9 +258,13 @@ var AttachmentFlags;
|
|
|
257
258
|
* This attachment has been edited using the remix feature on mobile
|
|
258
259
|
*/
|
|
259
260
|
AttachmentFlags[AttachmentFlags["IsRemix"] = 4] = "IsRemix";
|
|
261
|
+
/**
|
|
262
|
+
* This attachment was marked as a spoiler
|
|
263
|
+
*/
|
|
264
|
+
AttachmentFlags[AttachmentFlags["IsSpoiler"] = 8] = "IsSpoiler";
|
|
260
265
|
})(AttachmentFlags || (exports.AttachmentFlags = AttachmentFlags = {}));
|
|
261
266
|
/**
|
|
262
|
-
* https://discord.com/developers/
|
|
267
|
+
* https://docs.discord.com/developers/resources/channel#allowed-mentions-object-allowed-mention-types
|
|
263
268
|
*/
|
|
264
269
|
var AllowedMentionsTypes;
|
|
265
270
|
(function (AllowedMentionsTypes) {
|
|
@@ -2,7 +2,7 @@ import type { Identify, MakeRequired } from '../../common';
|
|
|
2
2
|
import type { APIAttachment, Snowflake } from '..';
|
|
3
3
|
import type { ChannelType } from '../utils';
|
|
4
4
|
/**
|
|
5
|
-
* https://discord.com/developers/
|
|
5
|
+
* https://docs.discord.com/developers/interactions/message-components#component-object
|
|
6
6
|
*/
|
|
7
7
|
export interface APIBaseComponent<T extends ComponentType> {
|
|
8
8
|
/**
|
|
@@ -11,7 +11,7 @@ export interface APIBaseComponent<T extends ComponentType> {
|
|
|
11
11
|
type: T;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* https://discord.com/developers/
|
|
14
|
+
* https://docs.discord.com/developers/interactions/message-components#component-object-component-types
|
|
15
15
|
*/
|
|
16
16
|
export declare enum ComponentType {
|
|
17
17
|
/**
|
|
@@ -96,7 +96,7 @@ export declare enum ComponentType {
|
|
|
96
96
|
Checkbox = 23
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
* https://discord.com/developers/
|
|
99
|
+
* https://docs.discord.com/developers/interactions/message-components#action-rows
|
|
100
100
|
*/
|
|
101
101
|
export interface APIActionRowComponent<T extends APIActionRowComponentTypes> extends APIBaseComponent<ComponentType.ActionRow> {
|
|
102
102
|
/**
|
|
@@ -105,7 +105,7 @@ export interface APIActionRowComponent<T extends APIActionRowComponentTypes> ext
|
|
|
105
105
|
components: T[];
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
|
-
* https://discord.com/developers/
|
|
108
|
+
* https://docs.discord.com/developers/interactions/message-components#buttons
|
|
109
109
|
*/
|
|
110
110
|
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
|
111
111
|
/**
|
|
@@ -159,7 +159,7 @@ export interface APIButtonComponentWithSKUId extends Omit<APIButtonComponentBase
|
|
|
159
159
|
}
|
|
160
160
|
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithSKUId | APIButtonComponentWithURL;
|
|
161
161
|
/**
|
|
162
|
-
* https://discord.com/developers/
|
|
162
|
+
* https://docs.discord.com/developers/interactions/message-components#button-object-button-styles
|
|
163
163
|
*/
|
|
164
164
|
export declare enum ButtonStyle {
|
|
165
165
|
Primary = 1,
|
|
@@ -170,14 +170,14 @@ export declare enum ButtonStyle {
|
|
|
170
170
|
Premium = 6
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
173
|
-
* https://discord.com/developers/
|
|
173
|
+
* https://docs.discord.com/developers/interactions/message-components#text-inputs-text-input-styles
|
|
174
174
|
*/
|
|
175
175
|
export declare enum TextInputStyle {
|
|
176
176
|
Short = 1,
|
|
177
177
|
Paragraph = 2
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
|
-
* https://discord.com/developers/
|
|
180
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menus
|
|
181
181
|
*/
|
|
182
182
|
export interface APIBaseSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect> extends APIBaseComponent<T> {
|
|
183
183
|
/**
|
|
@@ -220,7 +220,7 @@ export interface APIBaseAutoPopulatedSelectMenuComponent<T extends ComponentType
|
|
|
220
220
|
default_values?: APISelectMenuDefaultValue<D>[];
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
|
-
* https://discord.com/developers/
|
|
223
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menus
|
|
224
224
|
*/
|
|
225
225
|
export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
|
|
226
226
|
/**
|
|
@@ -235,19 +235,19 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
|
|
|
235
235
|
required?: boolean;
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
238
|
-
* https://discord.com/developers/
|
|
238
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menus
|
|
239
239
|
*/
|
|
240
240
|
export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.UserSelect, SelectMenuDefaultValueType.User>;
|
|
241
241
|
/**
|
|
242
|
-
* https://discord.com/developers/
|
|
242
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menus
|
|
243
243
|
*/
|
|
244
244
|
export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.RoleSelect, SelectMenuDefaultValueType.Role>;
|
|
245
245
|
/**
|
|
246
|
-
* https://discord.com/developers/
|
|
246
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menus
|
|
247
247
|
*/
|
|
248
248
|
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.MentionableSelect, SelectMenuDefaultValueType>;
|
|
249
249
|
/**
|
|
250
|
-
* https://discord.com/developers/
|
|
250
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menus
|
|
251
251
|
*/
|
|
252
252
|
export interface APIChannelSelectComponent extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
|
|
253
253
|
/**
|
|
@@ -256,7 +256,7 @@ export interface APIChannelSelectComponent extends APIBaseAutoPopulatedSelectMen
|
|
|
256
256
|
channel_types?: ChannelType[];
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
|
-
* https://discord.com/developers/
|
|
259
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menu-object-select-default-value-structure
|
|
260
260
|
*/
|
|
261
261
|
export declare enum SelectMenuDefaultValueType {
|
|
262
262
|
Channel = "channel",
|
|
@@ -264,7 +264,7 @@ export declare enum SelectMenuDefaultValueType {
|
|
|
264
264
|
User = "user"
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
|
-
* https://discord.com/developers/
|
|
267
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menu-object-select-default-value-structure
|
|
268
268
|
*/
|
|
269
269
|
export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
|
|
270
270
|
type: T;
|
|
@@ -272,11 +272,11 @@ export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType>
|
|
|
272
272
|
}
|
|
273
273
|
export type APIAutoPopulatedSelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIUserSelectComponent;
|
|
274
274
|
/**
|
|
275
|
-
* https://discord.com/developers/
|
|
275
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menus
|
|
276
276
|
*/
|
|
277
277
|
export type APISelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIStringSelectComponent | APIUserSelectComponent;
|
|
278
278
|
/**
|
|
279
|
-
* https://discord.com/developers/
|
|
279
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menu-object-select-option-structure
|
|
280
280
|
*/
|
|
281
281
|
export interface APISelectMenuOption {
|
|
282
282
|
/**
|
|
@@ -301,7 +301,7 @@ export interface APISelectMenuOption {
|
|
|
301
301
|
default?: boolean;
|
|
302
302
|
}
|
|
303
303
|
/**
|
|
304
|
-
* https://discord.com/developers/
|
|
304
|
+
* https://docs.discord.com/developers/interactions/message-components#text-inputs-text-input-structure
|
|
305
305
|
*/
|
|
306
306
|
export interface APITextInputComponent extends APIBaseComponent<ComponentType.TextInput> {
|
|
307
307
|
id?: number;
|
|
@@ -335,7 +335,7 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
|
|
335
335
|
required?: boolean;
|
|
336
336
|
}
|
|
337
337
|
/**
|
|
338
|
-
* https://discord.com/developers/
|
|
338
|
+
* https://docs.discord.com/developers/resources/channel#channel-object-channel-flags
|
|
339
339
|
*/
|
|
340
340
|
export declare enum ChannelFlags {
|
|
341
341
|
/**
|
|
@@ -374,22 +374,26 @@ export declare enum ChannelFlags {
|
|
|
374
374
|
/**
|
|
375
375
|
* Whether media download options are hidden.
|
|
376
376
|
*/
|
|
377
|
-
HideMediaDownloadOptions = 32768
|
|
377
|
+
HideMediaDownloadOptions = 32768,
|
|
378
|
+
/**
|
|
379
|
+
* This channel is a Spoiler Channel i.e. users must opt in to view its contents.
|
|
380
|
+
*/
|
|
381
|
+
IsSpoilerChannel = 2097152
|
|
378
382
|
}
|
|
379
383
|
/**
|
|
380
|
-
* https://discord.com/developers/
|
|
384
|
+
* https://docs.discord.com/developers/interactions/message-components#message-components
|
|
381
385
|
*/
|
|
382
386
|
export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
|
|
383
387
|
export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
|
|
384
388
|
export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;
|
|
385
389
|
/**
|
|
386
|
-
* https://discord.com/developers/
|
|
390
|
+
* https://docs.discord.com/developers/interactions/message-components#message-components
|
|
387
391
|
*/
|
|
388
392
|
export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent;
|
|
389
393
|
export type APIComponents = APIFileUploadComponent | APIMessageActionRowComponent | APIModalActionRowComponent | APIContainerComponent | APIContainerComponents | APITopLevelComponent | APILabelComponent | APIRadioGroupComponent | APICheckboxGroupComponent | APICheckboxComponent;
|
|
390
394
|
export type APIModalActionRowComponent = APITextInputComponent;
|
|
391
395
|
/**
|
|
392
|
-
* https://discord.com/developers/
|
|
396
|
+
* https://docs.discord.com/developers/components/reference#section
|
|
393
397
|
*
|
|
394
398
|
* A Section is a top-level layout component that allows you to join text contextually with an accessory.
|
|
395
399
|
*/
|
|
@@ -402,7 +406,7 @@ export interface APISectionComponent extends APIBaseComponent<ComponentType.Sect
|
|
|
402
406
|
accessory: APIButtonComponent | APIThumbnailComponent;
|
|
403
407
|
}
|
|
404
408
|
/**
|
|
405
|
-
* https://discord.com/developers/
|
|
409
|
+
* https://docs.discord.com/developers/components/reference#text-display
|
|
406
410
|
*
|
|
407
411
|
* A Text Display is a top-level content component that allows you to add text to your message formatted with markdown and mention users and roles. This is similar to the content field of a message, but allows you to add multiple text components, controlling the layout of your message.
|
|
408
412
|
* Text Displays are only available in messages.
|
|
@@ -414,7 +418,7 @@ export interface APITextDisplayComponent extends APIBaseComponent<ComponentType.
|
|
|
414
418
|
content: string;
|
|
415
419
|
}
|
|
416
420
|
/**
|
|
417
|
-
* https://discord.com/developers/
|
|
421
|
+
* https://docs.discord.com/developers/components/reference#thumbnail
|
|
418
422
|
*
|
|
419
423
|
* A Thumbnail is a content component that is a small image only usable as an accessory in a section. The preview comes from an url or attachment through the unfurled media item structure.
|
|
420
424
|
* Thumbnails are only available in messages as an accessory in a section.
|
|
@@ -430,7 +434,7 @@ export interface APIThumbnailComponent extends APIBaseComponent<ComponentType.Th
|
|
|
430
434
|
spoiler?: boolean;
|
|
431
435
|
}
|
|
432
436
|
/**
|
|
433
|
-
* https://discord.com/developers/
|
|
437
|
+
* https://docs.discord.com/developers/components/reference#media-gallery
|
|
434
438
|
*
|
|
435
439
|
* A Media Gallery is a top-level content component that allows you to display 1-10 media attachments in an organized gallery format. Each item can have optional descriptions and can be marked as spoilers.
|
|
436
440
|
* Media Galleries are only available in messages.
|
|
@@ -450,7 +454,7 @@ export interface APIMediaGalleryItems {
|
|
|
450
454
|
spoiler?: boolean;
|
|
451
455
|
}
|
|
452
456
|
/**
|
|
453
|
-
* https://discord.com/developers/
|
|
457
|
+
* https://docs.discord.com/developers/components/reference#file
|
|
454
458
|
*
|
|
455
459
|
* A File is a top-level component that allows you to display an uploaded file as an attachment to the message and reference it in the component. Each file component can only display 1 attached file, but you can upload multiple files and add them to different file components within your payload. This is similar to the embeds field of a message but allows you to control the layout of your message by using this anywhere as a component.
|
|
456
460
|
* Files are only available in messages.
|
|
@@ -464,7 +468,7 @@ export interface APIFileComponent extends APIBaseComponent<ComponentType.File> {
|
|
|
464
468
|
spoiler?: boolean;
|
|
465
469
|
}
|
|
466
470
|
/**
|
|
467
|
-
* https://discord.com/developers/
|
|
471
|
+
* https://docs.discord.com/developers/components/reference#separator
|
|
468
472
|
*
|
|
469
473
|
* A Separator is a top-level layout component that adds vertical padding and visual division between other components.
|
|
470
474
|
*/
|
|
@@ -484,7 +488,7 @@ export declare enum Spacing {
|
|
|
484
488
|
}
|
|
485
489
|
export type APIContainerComponents = APIActionRowComponent<APIActionRowComponentTypes> | APITextDisplayComponent | APISectionComponent | APIMediaGalleryComponent | APIFileComponent | APISeparatorComponent | APIThumbnailComponent;
|
|
486
490
|
/**
|
|
487
|
-
* https://discord.com/developers/
|
|
491
|
+
* https://docs.discord.com/developers/components/reference#container
|
|
488
492
|
*/
|
|
489
493
|
export interface APIContainerComponent extends APIBaseComponent<ComponentType.Container> {
|
|
490
494
|
/** Optional identifier for component */
|
|
@@ -498,7 +502,7 @@ export interface APIContainerComponent extends APIBaseComponent<ComponentType.Co
|
|
|
498
502
|
}
|
|
499
503
|
export type APILabelComponents = APITextInputComponent | APISelectMenuComponent | APIFileUploadComponent | APIRadioGroupComponent | APICheckboxGroupComponent | APICheckboxComponent;
|
|
500
504
|
/**
|
|
501
|
-
* https://discord.com/developers/
|
|
505
|
+
* https://docs.discord.com/developers/components/reference#label
|
|
502
506
|
*/
|
|
503
507
|
export interface APILabelComponent extends APIBaseComponent<ComponentType.Label> {
|
|
504
508
|
/** Optional identifier for component */
|
|
@@ -511,7 +515,11 @@ export interface APILabelComponent extends APIBaseComponent<ComponentType.Label>
|
|
|
511
515
|
component: APILabelComponents;
|
|
512
516
|
}
|
|
513
517
|
/**
|
|
514
|
-
* https://discord.com/developers/
|
|
518
|
+
* https://docs.discord.com/developers/reference#file-type-filtering
|
|
519
|
+
*/
|
|
520
|
+
export type FileUploadType = 'audio' | 'image' | 'video' | `.${string}`;
|
|
521
|
+
/**
|
|
522
|
+
* https://docs.discord.com/developers/components/reference#file-upload
|
|
515
523
|
*/
|
|
516
524
|
export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.FileUpload> {
|
|
517
525
|
/** Optional identifier for component */
|
|
@@ -524,6 +532,8 @@ export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.F
|
|
|
524
532
|
max_values?: number;
|
|
525
533
|
/** Whether the file upload is required (defaults to false) */
|
|
526
534
|
required?: boolean;
|
|
535
|
+
/** File types to accept; can contain media groups or dot-prefixed file extensions (maximum of 10) */
|
|
536
|
+
file_types?: FileUploadType[];
|
|
527
537
|
}
|
|
528
538
|
/**
|
|
529
539
|
* https://docs.discord.com/developers/components/reference#radio-group
|
|
@@ -593,7 +603,7 @@ export interface APICheckboxComponent extends APIBaseComponent<ComponentType.Che
|
|
|
593
603
|
default?: boolean;
|
|
594
604
|
}
|
|
595
605
|
/**
|
|
596
|
-
* https://discord.com/developers/
|
|
606
|
+
* https://docs.discord.com/developers/components/reference#unfurled-media-item-structure
|
|
597
607
|
*/
|
|
598
608
|
export interface APIUnfurledMediaItem extends Identify<MakeRequired<Partial<Pick<APIAttachment, 'url' | 'proxy_url' | 'height' | 'width' | 'content_type'>>, 'url'>> {
|
|
599
609
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Spacing = exports.ChannelFlags = exports.SelectMenuDefaultValueType = exports.TextInputStyle = exports.ButtonStyle = exports.ComponentType = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* https://discord.com/developers/
|
|
5
|
+
* https://docs.discord.com/developers/interactions/message-components#component-object-component-types
|
|
6
6
|
*/
|
|
7
7
|
var ComponentType;
|
|
8
8
|
(function (ComponentType) {
|
|
@@ -88,7 +88,7 @@ var ComponentType;
|
|
|
88
88
|
ComponentType[ComponentType["Checkbox"] = 23] = "Checkbox";
|
|
89
89
|
})(ComponentType || (exports.ComponentType = ComponentType = {}));
|
|
90
90
|
/**
|
|
91
|
-
* https://discord.com/developers/
|
|
91
|
+
* https://docs.discord.com/developers/interactions/message-components#button-object-button-styles
|
|
92
92
|
*/
|
|
93
93
|
var ButtonStyle;
|
|
94
94
|
(function (ButtonStyle) {
|
|
@@ -100,7 +100,7 @@ var ButtonStyle;
|
|
|
100
100
|
ButtonStyle[ButtonStyle["Premium"] = 6] = "Premium";
|
|
101
101
|
})(ButtonStyle || (exports.ButtonStyle = ButtonStyle = {}));
|
|
102
102
|
/**
|
|
103
|
-
* https://discord.com/developers/
|
|
103
|
+
* https://docs.discord.com/developers/interactions/message-components#text-inputs-text-input-styles
|
|
104
104
|
*/
|
|
105
105
|
var TextInputStyle;
|
|
106
106
|
(function (TextInputStyle) {
|
|
@@ -108,7 +108,7 @@ var TextInputStyle;
|
|
|
108
108
|
TextInputStyle[TextInputStyle["Paragraph"] = 2] = "Paragraph";
|
|
109
109
|
})(TextInputStyle || (exports.TextInputStyle = TextInputStyle = {}));
|
|
110
110
|
/**
|
|
111
|
-
* https://discord.com/developers/
|
|
111
|
+
* https://docs.discord.com/developers/interactions/message-components#select-menu-object-select-default-value-structure
|
|
112
112
|
*/
|
|
113
113
|
var SelectMenuDefaultValueType;
|
|
114
114
|
(function (SelectMenuDefaultValueType) {
|
|
@@ -117,7 +117,7 @@ var SelectMenuDefaultValueType;
|
|
|
117
117
|
SelectMenuDefaultValueType["User"] = "user";
|
|
118
118
|
})(SelectMenuDefaultValueType || (exports.SelectMenuDefaultValueType = SelectMenuDefaultValueType = {}));
|
|
119
119
|
/**
|
|
120
|
-
* https://discord.com/developers/
|
|
120
|
+
* https://docs.discord.com/developers/resources/channel#channel-object-channel-flags
|
|
121
121
|
*/
|
|
122
122
|
var ChannelFlags;
|
|
123
123
|
(function (ChannelFlags) {
|
|
@@ -158,6 +158,10 @@ var ChannelFlags;
|
|
|
158
158
|
* Whether media download options are hidden.
|
|
159
159
|
*/
|
|
160
160
|
ChannelFlags[ChannelFlags["HideMediaDownloadOptions"] = 32768] = "HideMediaDownloadOptions";
|
|
161
|
+
/**
|
|
162
|
+
* This channel is a Spoiler Channel i.e. users must opt in to view its contents.
|
|
163
|
+
*/
|
|
164
|
+
ChannelFlags[ChannelFlags["IsSpoilerChannel"] = 2097152] = "IsSpoilerChannel";
|
|
161
165
|
})(ChannelFlags || (exports.ChannelFlags = ChannelFlags = {}));
|
|
162
166
|
var Spacing;
|
|
163
167
|
(function (Spacing) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Types extracted from https://discord.com/developers/
|
|
2
|
+
* Types extracted from https://docs.discord.com/developers/resources/emoji
|
|
3
3
|
*/
|
|
4
4
|
import type { Snowflake } from '../index';
|
|
5
5
|
import type { APIRole } from './permissions';
|
|
@@ -22,7 +22,7 @@ export interface APIPartialEmoji {
|
|
|
22
22
|
animated?: boolean;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* https://discord.com/developers/
|
|
25
|
+
* https://docs.discord.com/developers/resources/emoji#emoji-object-emoji-structure
|
|
26
26
|
*/
|
|
27
27
|
export interface APIEmoji extends APIPartialEmoji {
|
|
28
28
|
/**
|