oceanic.js 1.10.3-dev.c6c9f52 → 1.10.3-dev.ca8b6e8
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 +99 -0
- package/dist/lib/Client.js +263 -0
- package/dist/lib/Constants.d.ts +1215 -0
- package/dist/lib/Constants.js +1513 -0
- package/dist/lib/gateway/Shard.d.ts +83 -0
- package/dist/lib/gateway/Shard.js +1621 -0
- package/dist/lib/gateway/ShardManager.d.ts +29 -0
- package/dist/lib/gateway/ShardManager.js +300 -0
- package/dist/lib/index.d.ts +84 -0
- package/dist/lib/index.js +168 -0
- package/dist/lib/rest/Bucket.d.ts +33 -0
- package/dist/lib/rest/Bucket.js +78 -0
- package/dist/lib/rest/DiscordHTTPError.d.ts +16 -0
- package/dist/lib/rest/DiscordHTTPError.js +65 -0
- package/dist/lib/rest/DiscordRESTError.d.ts +19 -0
- package/dist/lib/rest/DiscordRESTError.js +89 -0
- package/dist/lib/rest/OAuthHelper.d.ts +62 -0
- package/dist/lib/rest/OAuthHelper.js +183 -0
- package/dist/lib/rest/RESTManager.d.ts +42 -0
- package/dist/lib/rest/RESTManager.js +82 -0
- package/dist/lib/rest/RequestHandler.d.ts +28 -0
- package/dist/lib/rest/RequestHandler.js +313 -0
- package/dist/lib/rest/SequentialBucket.d.ts +25 -0
- package/dist/lib/rest/SequentialBucket.js +76 -0
- package/dist/lib/routes/Applications.d.ts +171 -0
- package/dist/lib/routes/Applications.js +447 -0
- package/dist/lib/routes/Channels.d.ts +408 -0
- package/dist/lib/routes/Channels.js +1160 -0
- package/dist/lib/routes/Guilds.d.ts +606 -0
- package/dist/lib/routes/Guilds.js +1669 -0
- package/dist/lib/routes/Interactions.d.ts +74 -0
- package/dist/lib/routes/Interactions.js +141 -0
- package/dist/lib/routes/Miscellaneous.d.ts +31 -0
- package/dist/lib/routes/Miscellaneous.js +69 -0
- package/dist/lib/routes/OAuth.d.ts +108 -0
- package/dist/lib/routes/OAuth.js +312 -0
- package/dist/lib/routes/Users.d.ts +32 -0
- package/dist/lib/routes/Users.js +59 -0
- package/dist/lib/routes/Webhooks.d.ts +128 -0
- package/dist/lib/routes/Webhooks.js +265 -0
- package/dist/lib/structures/AnnouncementChannel.d.ts +36 -0
- package/dist/lib/structures/AnnouncementChannel.js +47 -0
- package/dist/lib/structures/AnnouncementThreadChannel.d.ts +18 -0
- package/dist/lib/structures/AnnouncementThreadChannel.js +27 -0
- package/dist/lib/structures/Application.d.ts +102 -0
- package/dist/lib/structures/Application.js +189 -0
- package/dist/lib/structures/ApplicationCommand.d.ts +74 -0
- package/dist/lib/structures/ApplicationCommand.js +141 -0
- package/dist/lib/structures/Attachment.d.ts +34 -0
- package/dist/lib/structures/Attachment.js +64 -0
- package/dist/lib/structures/AuditLogEntry.d.ts +25 -0
- package/dist/lib/structures/AuditLogEntry.js +53 -0
- package/dist/lib/structures/AutoModerationRule.d.ts +49 -0
- package/dist/lib/structures/AutoModerationRule.js +139 -0
- package/dist/lib/structures/AutocompleteInteraction.d.ts +62 -0
- package/dist/lib/structures/AutocompleteInteraction.js +115 -0
- package/dist/lib/structures/Base.d.ts +20 -0
- package/dist/lib/structures/Base.js +58 -0
- package/dist/lib/structures/BaseEntitlement.d.ts +19 -0
- package/dist/lib/structures/BaseEntitlement.js +44 -0
- package/dist/lib/structures/CategoryChannel.d.ts +41 -0
- package/dist/lib/structures/CategoryChannel.js +105 -0
- package/dist/lib/structures/Channel.d.ts +20 -0
- package/dist/lib/structures/Channel.js +91 -0
- package/dist/lib/structures/ClientApplication.d.ts +153 -0
- package/dist/lib/structures/ClientApplication.js +220 -0
- package/dist/lib/structures/CommandInteraction.d.ts +127 -0
- package/dist/lib/structures/CommandInteraction.js +297 -0
- package/dist/lib/structures/ComponentInteraction.d.ts +137 -0
- package/dist/lib/structures/ComponentInteraction.js +311 -0
- package/dist/lib/structures/Entitlement.d.ts +12 -0
- package/dist/lib/structures/Entitlement.js +26 -0
- package/dist/lib/structures/ExtendedUser.d.ts +26 -0
- package/dist/lib/structures/ExtendedUser.js +57 -0
- package/dist/lib/structures/ForumChannel.d.ts +11 -0
- package/dist/lib/structures/ForumChannel.js +19 -0
- package/dist/lib/structures/GroupChannel.d.ts +62 -0
- package/dist/lib/structures/GroupChannel.js +133 -0
- package/dist/lib/structures/Guild.d.ts +654 -0
- package/dist/lib/structures/Guild.js +1319 -0
- package/dist/lib/structures/GuildChannel.d.ts +34 -0
- package/dist/lib/structures/GuildChannel.js +75 -0
- package/dist/lib/structures/GuildPreview.d.ts +50 -0
- package/dist/lib/structures/GuildPreview.js +119 -0
- package/dist/lib/structures/GuildScheduledEvent.d.ts +60 -0
- package/dist/lib/structures/GuildScheduledEvent.js +154 -0
- package/dist/lib/structures/GuildTemplate.d.ts +55 -0
- package/dist/lib/structures/GuildTemplate.js +126 -0
- package/dist/lib/structures/Integration.d.ts +54 -0
- package/dist/lib/structures/Integration.js +156 -0
- package/dist/lib/structures/Interaction.d.ts +40 -0
- package/dist/lib/structures/Interaction.js +90 -0
- package/dist/lib/structures/InteractionResolvedChannel.d.ts +28 -0
- package/dist/lib/structures/InteractionResolvedChannel.js +45 -0
- package/dist/lib/structures/Invite.d.ts +64 -0
- package/dist/lib/structures/Invite.js +193 -0
- package/dist/lib/structures/InviteGuild.d.ts +52 -0
- package/dist/lib/structures/InviteGuild.js +88 -0
- package/dist/lib/structures/MediaChannel.d.ts +11 -0
- package/dist/lib/structures/MediaChannel.js +19 -0
- package/dist/lib/structures/Member.d.ts +122 -0
- package/dist/lib/structures/Member.js +255 -0
- package/dist/lib/structures/Message.d.ts +194 -0
- package/dist/lib/structures/Message.js +477 -0
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +128 -0
- package/dist/lib/structures/ModalSubmitInteraction.js +240 -0
- package/dist/lib/structures/OAuthApplication.d.ts +79 -0
- package/dist/lib/structures/OAuthApplication.js +210 -0
- package/dist/lib/structures/OAuthGuild.d.ts +35 -0
- package/dist/lib/structures/OAuthGuild.js +61 -0
- package/dist/lib/structures/PartialApplication.d.ts +30 -0
- package/dist/lib/structures/PartialApplication.js +67 -0
- package/dist/lib/structures/Permission.d.ts +21 -0
- package/dist/lib/structures/Permission.js +68 -0
- package/dist/lib/structures/PermissionOverwrite.d.ts +26 -0
- package/dist/lib/structures/PermissionOverwrite.js +49 -0
- package/dist/lib/structures/PingInteraction.d.ts +16 -0
- package/dist/lib/structures/PingInteraction.js +26 -0
- package/dist/lib/structures/Poll.d.ts +28 -0
- package/dist/lib/structures/Poll.js +78 -0
- package/dist/lib/structures/PrivateChannel.d.ts +90 -0
- package/dist/lib/structures/PrivateChannel.js +131 -0
- package/dist/lib/structures/PrivateThreadChannel.d.ts +18 -0
- package/dist/lib/structures/PrivateThreadChannel.js +27 -0
- package/dist/lib/structures/PublicThreadChannel.d.ts +21 -0
- package/dist/lib/structures/PublicThreadChannel.js +37 -0
- package/dist/lib/structures/Role.d.ts +52 -0
- package/dist/lib/structures/Role.js +137 -0
- package/dist/lib/structures/SKU.d.ts +32 -0
- package/dist/lib/structures/SKU.js +53 -0
- package/dist/lib/structures/StageChannel.d.ts +33 -0
- package/dist/lib/structures/StageChannel.js +44 -0
- package/dist/lib/structures/StageInstance.d.ts +36 -0
- package/dist/lib/structures/StageInstance.js +94 -0
- package/dist/lib/structures/Team.d.ts +22 -0
- package/dist/lib/structures/Team.js +67 -0
- package/dist/lib/structures/TestEntitlement.d.ts +10 -0
- package/dist/lib/structures/TestEntitlement.js +21 -0
- package/dist/lib/structures/TextChannel.d.ts +34 -0
- package/dist/lib/structures/TextChannel.js +46 -0
- package/dist/lib/structures/TextableChannel.d.ts +158 -0
- package/dist/lib/structures/TextableChannel.js +276 -0
- package/dist/lib/structures/TextableVoiceChannel.d.ts +39 -0
- package/dist/lib/structures/TextableVoiceChannel.js +81 -0
- package/dist/lib/structures/ThreadChannel.d.ts +159 -0
- package/dist/lib/structures/ThreadChannel.js +295 -0
- package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
- package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
- package/dist/lib/structures/ThreadableChannel.d.ts +36 -0
- package/dist/lib/structures/ThreadableChannel.js +58 -0
- package/dist/lib/structures/UnavailableGuild.d.ts +11 -0
- package/dist/lib/structures/UnavailableGuild.js +21 -0
- package/dist/lib/structures/User.d.ts +82 -0
- package/dist/lib/structures/User.js +168 -0
- package/dist/lib/structures/VoiceChannel.d.ts +20 -0
- package/dist/lib/structures/VoiceChannel.js +35 -0
- package/dist/lib/structures/VoiceState.d.ts +51 -0
- package/dist/lib/structures/VoiceState.js +140 -0
- package/dist/lib/structures/Webhook.d.ts +129 -0
- package/dist/lib/structures/Webhook.js +206 -0
- package/dist/lib/types/applications.d.ts +466 -0
- package/dist/lib/types/audit-log.d.ts +122 -0
- package/dist/lib/types/auto-moderation.d.ts +99 -0
- package/dist/lib/types/channels.d.ts +1244 -0
- package/dist/lib/types/client.d.ts +228 -0
- package/dist/lib/types/events.d.ts +265 -0
- package/dist/lib/types/gateway-raw.d.ts +584 -0
- package/dist/lib/types/gateway.d.ts +351 -0
- package/dist/lib/types/guild-template.d.ts +33 -0
- package/dist/lib/types/guilds.d.ts +855 -0
- package/dist/lib/types/index.d.ts +18 -0
- package/dist/lib/types/interactions.d.ts +377 -0
- package/dist/lib/types/json.d.ts +742 -0
- package/dist/lib/types/misc.d.ts +28 -0
- package/dist/lib/types/oauth.d.ts +201 -0
- package/dist/lib/types/request-handler.d.ts +52 -0
- package/dist/lib/types/scheduled-events.d.ts +88 -0
- package/dist/lib/types/shared.d.ts +9 -0
- package/dist/lib/types/users.d.ts +45 -0
- package/dist/lib/types/voice.d.ts +45 -0
- package/dist/lib/types/webhooks.d.ts +74 -0
- package/dist/lib/util/Collection.d.ts +47 -0
- package/dist/lib/util/Collection.js +78 -0
- package/dist/lib/util/Errors.d.ts +29 -0
- package/dist/lib/util/Errors.js +56 -0
- package/dist/lib/util/Routes.d.ts +127 -0
- package/dist/lib/util/Routes.js +248 -0
- package/dist/lib/util/SimpleCollection.d.ts +12 -0
- package/dist/lib/util/SimpleCollection.js +81 -0
- package/dist/lib/util/TypedCollection.d.ts +24 -0
- package/dist/lib/util/TypedCollection.js +76 -0
- package/dist/lib/util/TypedEmitter.d.ts +19 -0
- package/dist/lib/util/TypedEmitter.js +19 -0
- package/dist/lib/util/Util.d.ts +58 -0
- package/dist/lib/util/Util.js +535 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.js +213 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +24 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.js +28 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +24 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +34 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +60 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +124 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @module Types/Index */
|
|
2
|
+
export * from "./applications";
|
|
3
|
+
export * from "./audit-log";
|
|
4
|
+
export * from "./auto-moderation";
|
|
5
|
+
export * from "./channels";
|
|
6
|
+
export * from "./client";
|
|
7
|
+
export * from "./events";
|
|
8
|
+
export * from "./gateway";
|
|
9
|
+
export * from "./guilds";
|
|
10
|
+
export * from "./interactions";
|
|
11
|
+
export * from "./json";
|
|
12
|
+
export * from "./oauth";
|
|
13
|
+
export * from "./request-handler";
|
|
14
|
+
export * from "./scheduled-events";
|
|
15
|
+
export * from "./shared";
|
|
16
|
+
export * from "./users";
|
|
17
|
+
export * from "./voice";
|
|
18
|
+
export * from "./webhooks";
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/** @module Types/Interactions */
|
|
2
|
+
import type { EditWebhookMessageOptions, ExecuteWebhookOptions } from "./webhooks";
|
|
3
|
+
import type {
|
|
4
|
+
AnyTextableGuildChannel,
|
|
5
|
+
AnyPrivateChannel,
|
|
6
|
+
ModalActionRow,
|
|
7
|
+
RawAttachment,
|
|
8
|
+
RawInteractionResolvedChannel,
|
|
9
|
+
RawMessage,
|
|
10
|
+
AnyInteractionChannel
|
|
11
|
+
} from "./channels";
|
|
12
|
+
import type { InteractionMember, RawMember, RawRole } from "./guilds";
|
|
13
|
+
import type { RawUser } from "./users";
|
|
14
|
+
import type { Uncached } from "./shared";
|
|
15
|
+
import type { LocaleMap, RawEntitlement, RawTestEntitlement } from "./applications";
|
|
16
|
+
import type {
|
|
17
|
+
ApplicationCommandOptionTypes,
|
|
18
|
+
ApplicationCommandTypes,
|
|
19
|
+
ApplicationIntegrationTypes,
|
|
20
|
+
ComponentTypes,
|
|
21
|
+
GuildFeature,
|
|
22
|
+
InteractionContextTypes,
|
|
23
|
+
InteractionResponseTypes,
|
|
24
|
+
InteractionTypes,
|
|
25
|
+
MessageComponentTypes,
|
|
26
|
+
ModalComponentTypes,
|
|
27
|
+
SelectMenuTypes
|
|
28
|
+
} from "../Constants";
|
|
29
|
+
import type Attachment from "../structures/Attachment";
|
|
30
|
+
import type Member from "../structures/Member";
|
|
31
|
+
import type Message from "../structures/Message";
|
|
32
|
+
import type Role from "../structures/Role";
|
|
33
|
+
import type User from "../structures/User";
|
|
34
|
+
import type PingInteraction from "../structures/PingInteraction";
|
|
35
|
+
import type CommandInteraction from "../structures/CommandInteraction";
|
|
36
|
+
import type ComponentInteraction from "../structures/ComponentInteraction";
|
|
37
|
+
import type AutocompleteInteraction from "../structures/AutocompleteInteraction";
|
|
38
|
+
import type ModalSubmitInteraction from "../structures/ModalSubmitInteraction";
|
|
39
|
+
import type InteractionOptionsWrapper from "../util/interactions/InteractionOptionsWrapper";
|
|
40
|
+
import type TypedCollection from "../util/TypedCollection";
|
|
41
|
+
import type InteractionResolvedChannel from "../structures/InteractionResolvedChannel";
|
|
42
|
+
import type SelectMenuValuesWrapper from "../util/interactions/SelectMenuValuesWrapper";
|
|
43
|
+
import type Interaction from "../structures/Interaction";
|
|
44
|
+
import type Guild from "../structures/Guild";
|
|
45
|
+
import type Permission from "../structures/Permission";
|
|
46
|
+
import type ModalSubmitInteractionComponentsWrapper from "../util/interactions/ModalSubmitInteractionComponentsWrapper";
|
|
47
|
+
|
|
48
|
+
export interface InteractionContent extends Pick<ExecuteWebhookOptions, "tts" | "content" | "embeds" | "allowedMentions" | "flags" | "components" | "attachments" | "files" | "poll"> {}
|
|
49
|
+
export interface EditInteractionContent extends Pick<EditWebhookMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "attachments" | "files"> {}
|
|
50
|
+
export interface InitialInteractionContent extends Omit<InteractionContent, "attachments" | "files"> {}
|
|
51
|
+
|
|
52
|
+
export type InteractionResponse = PingInteractionResponse | MessageInteractionResponse | DeferredInteractionResponse | AutocompleteInteractionResponse | ModalSubmitInteractionResponse | PremiumRequiredResponse;
|
|
53
|
+
export interface PingInteractionResponse {
|
|
54
|
+
type: InteractionResponseTypes.PONG;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface MessageInteractionResponse {
|
|
58
|
+
/** The [response data](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-messages). Convert any `snake_case` keys to `camelCase`. */
|
|
59
|
+
data: InteractionContent;
|
|
60
|
+
type: InteractionResponseTypes.CHANNEL_MESSAGE_WITH_SOURCE | InteractionResponseTypes.UPDATE_MESSAGE;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface DeferredInteractionResponse {
|
|
64
|
+
/** The response data. Only [flags](https://discord.com/developers/docs/resources/channel#message-object-message-flags) can be sent. */
|
|
65
|
+
data?: { flags?: number; };
|
|
66
|
+
type: InteractionResponseTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE | InteractionResponseTypes.DEFERRED_UPDATE_MESSAGE;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface AutocompleteInteractionResponse {
|
|
70
|
+
/** The [response data](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-autocomplete). */
|
|
71
|
+
data: { choices: Array<AutocompleteChoice>; };
|
|
72
|
+
type: InteractionResponseTypes.APPLICATION_COMMAND_AUTOCOMPLETE_RESULT;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ModalSubmitInteractionResponse {
|
|
76
|
+
/** The [response data](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal). Convert any `snake_case` keys to `camelCase`. */
|
|
77
|
+
data: ModalData;
|
|
78
|
+
type: InteractionResponseTypes.MODAL;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface PremiumRequiredResponse {
|
|
82
|
+
data: Record<string, never>;
|
|
83
|
+
type: InteractionResponseTypes.PREMIUM_REQUIRED;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
export interface ModalData {
|
|
88
|
+
/** The components of the modal. Each component needs its own row. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawModalComponents | Util#rawModalComponents}. */
|
|
89
|
+
components: Array<ModalActionRow>;
|
|
90
|
+
/** The custom ID of the modal. */
|
|
91
|
+
customID: string;
|
|
92
|
+
/** The title of the modal. */
|
|
93
|
+
title: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface RawInteraction {
|
|
97
|
+
app_permissions: string;
|
|
98
|
+
application_id: string;
|
|
99
|
+
authorizing_integration_owners: AuthorizingIntegrationOwners;
|
|
100
|
+
channel_id?: string;
|
|
101
|
+
context?: InteractionContextTypes;
|
|
102
|
+
data?: RawInteractionData;
|
|
103
|
+
entitlements?: Array<RawEntitlement | RawTestEntitlement>;
|
|
104
|
+
guild?: InteractionGuild;
|
|
105
|
+
guild_id?: string;
|
|
106
|
+
guild_locale?: string;
|
|
107
|
+
id: string;
|
|
108
|
+
locale?: string;
|
|
109
|
+
member?: InteractionMember;
|
|
110
|
+
message?: RawMessage;
|
|
111
|
+
token: string;
|
|
112
|
+
type: InteractionTypes;
|
|
113
|
+
user?: RawUser;
|
|
114
|
+
version: 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface AuthorizingIntegrationOwners extends Partial<Record<`${ApplicationIntegrationTypes}`, string>> {}
|
|
118
|
+
|
|
119
|
+
export type AnyRawInteraction = RawPingInteraction | AnyRawGatewayInteraction;
|
|
120
|
+
export type AnyRawGatewayInteraction = RawApplicationCommandInteraction | RawMessageComponentInteraction | RawAutocompleteInteraction | RawModalSubmitInteraction;
|
|
121
|
+
export interface RawPingInteraction extends Pick<RawInteraction, "application_id" | "id" | "token" | "type" | "version"> {}
|
|
122
|
+
export interface RawApplicationCommandInteraction extends Omit<RawInteraction, "data" | "message"> { data: RawApplicationCommandInteractionData; }
|
|
123
|
+
export interface RawMessageComponentInteraction extends Omit<RawInteraction, "data" | "message"> { data: RawMessageComponentInteractionData; message: RawMessage; }
|
|
124
|
+
export interface RawAutocompleteInteraction extends Omit<RawInteraction, "data" | "message"> { data: RawAutocompleteInteractionData; }
|
|
125
|
+
export interface RawModalSubmitInteraction extends Omit<RawInteraction, "data" | "message"> { data: RawModalSubmitInteractionData; message?: RawMessage; }
|
|
126
|
+
|
|
127
|
+
export type RawInteractionData = RawApplicationCommandInteractionData | RawMessageComponentInteractionData | RawAutocompleteInteractionData | RawModalSubmitInteractionData;
|
|
128
|
+
export type InteractionData = ApplicationCommandInteractionData | MessageComponentInteractionData | AutocompleteInteractionData | ModalSubmitInteractionData;
|
|
129
|
+
export interface RawApplicationCommandInteractionData {
|
|
130
|
+
guild_id?: string;
|
|
131
|
+
id: string;
|
|
132
|
+
name: string;
|
|
133
|
+
options?: Array<InteractionOptions>;
|
|
134
|
+
resolved?: RawApplicationCommandInteractionResolvedData;
|
|
135
|
+
target_id?: string;
|
|
136
|
+
type: ApplicationCommandTypes;
|
|
137
|
+
}
|
|
138
|
+
export interface ApplicationCommandInteractionData<T extends AnyInteractionChannel | Uncached = AnyInteractionChannel | Uncached, C extends ApplicationCommandTypes = ApplicationCommandTypes> {
|
|
139
|
+
guildID?: string;
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
options: InteractionOptionsWrapper;
|
|
143
|
+
resolved: ApplicationCommandInteractionResolvedData;
|
|
144
|
+
target: C extends ApplicationCommandTypes.CHAT_INPUT ? null : C extends ApplicationCommandTypes.USER ? User : C extends ApplicationCommandTypes.MESSAGE ? Message<T> : User | Message<T> | null;
|
|
145
|
+
targetID: C extends ApplicationCommandTypes.CHAT_INPUT ? null : C extends ApplicationCommandTypes.USER | ApplicationCommandTypes.MESSAGE ? string : string | null;
|
|
146
|
+
type: C;
|
|
147
|
+
}
|
|
148
|
+
export interface RawAutocompleteInteractionData extends Omit<RawApplicationCommandInteractionData, "resolved" | "target_id"> {}
|
|
149
|
+
export interface AutocompleteInteractionData extends Omit<ApplicationCommandInteractionData, "resolved" | "target" | "targetID"> {}
|
|
150
|
+
|
|
151
|
+
export interface RawMessageComponentInteractionResolvedData {
|
|
152
|
+
channels?: Record<string, RawInteractionResolvedChannel>;
|
|
153
|
+
members?: Record<string, Omit<RawMember, "user" | "deaf" | "mute">>;
|
|
154
|
+
roles?: Record<string, RawRole>;
|
|
155
|
+
users?: Record<string, RawUser>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface MessageComponentInteractionResolvedData {
|
|
159
|
+
channels: TypedCollection<RawInteractionResolvedChannel, InteractionResolvedChannel>;
|
|
160
|
+
members: TypedCollection<RawMember, Member, [guildID: string]>;
|
|
161
|
+
roles: TypedCollection<RawRole, Role, [guildID: string]>;
|
|
162
|
+
users: TypedCollection<RawUser, User>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface RawMessageComponentInteractionData {
|
|
166
|
+
component_type: MessageComponentTypes;
|
|
167
|
+
custom_id: string;
|
|
168
|
+
resolved?: RawMessageComponentInteractionResolvedData;
|
|
169
|
+
values?: Array<string>;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type MessageComponentInteractionData = MessageComponentButtonInteractionData | MessageComponentSelectMenuInteractionData;
|
|
173
|
+
export interface MessageComponentButtonInteractionData {
|
|
174
|
+
componentType: ComponentTypes.BUTTON;
|
|
175
|
+
customID: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface MessageComponentSelectMenuInteractionData {
|
|
179
|
+
componentType: SelectMenuTypes;
|
|
180
|
+
customID: string;
|
|
181
|
+
resolved: MessageComponentInteractionResolvedData;
|
|
182
|
+
values: SelectMenuValuesWrapper;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface RawModalSubmitInteractionData {
|
|
186
|
+
components: Array<RawModalSubmitComponentsActionRow>;
|
|
187
|
+
custom_id: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface ModalSubmitInteractionData {
|
|
191
|
+
components: ModalSubmitInteractionComponentsWrapper;
|
|
192
|
+
customID: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface RawApplicationCommandInteractionResolvedData {
|
|
196
|
+
attachments?: Record<string, RawAttachment>;
|
|
197
|
+
channels?: Record<string, RawInteractionResolvedChannel>;
|
|
198
|
+
members?: Record<string, Omit<RawMember, "user" | "deaf" | "mute">>;
|
|
199
|
+
messages?: Record<string, RawMessage>;
|
|
200
|
+
roles?: Record<string, RawRole>;
|
|
201
|
+
users?: Record<string, RawUser>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface ApplicationCommandInteractionResolvedData {
|
|
205
|
+
attachments: TypedCollection<RawAttachment, Attachment>;
|
|
206
|
+
channels: TypedCollection<RawInteractionResolvedChannel, InteractionResolvedChannel>;
|
|
207
|
+
members: TypedCollection<RawMember, Member, [guildID: string]>;
|
|
208
|
+
messages: TypedCollection<RawMessage, Message>;
|
|
209
|
+
roles: TypedCollection<RawRole, Role, [guildID: string]>;
|
|
210
|
+
users: TypedCollection<RawUser, User>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export type InteractionOptions = InteractionOptionsWithOptions | InteractionOptionsWithValue;
|
|
214
|
+
export type InteractionOptionsWithOptions = InteractionOptionsSubCommand | InteractionOptionsSubCommandGroup;
|
|
215
|
+
export type InteractionOptionsWithValue = InteractionOptionsString | InteractionOptionsInteger | InteractionOptionsBoolean | InteractionOptionsUser | InteractionOptionsChannel | InteractionOptionsRole | InteractionOptionsMentionable | InteractionOptionsNumber | InteractionOptionsAttachment;
|
|
216
|
+
export interface InteractionOptionsBase {
|
|
217
|
+
focused?: boolean;
|
|
218
|
+
name: string;
|
|
219
|
+
type: ApplicationCommandOptionTypes;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface InteractionOptionsSubCommand extends InteractionOptionsBase {
|
|
223
|
+
options?: Array<InteractionOptionsWithValue>;
|
|
224
|
+
type: ApplicationCommandOptionTypes.SUB_COMMAND;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface InteractionOptionsSubCommandGroup extends InteractionOptionsBase {
|
|
228
|
+
options?: Array<InteractionOptionsSubCommand | InteractionOptionsWithValue>;
|
|
229
|
+
type: ApplicationCommandOptionTypes.SUB_COMMAND_GROUP;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface InteractionOptionsStringValue<T extends InteractionOptionsStringTypes = InteractionOptionsStringTypes> extends InteractionOptionsBase {
|
|
233
|
+
type: T;
|
|
234
|
+
value: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface InteractionOptionsNumberValue<T extends InteractionOptionsNumberTypes = InteractionOptionsNumberTypes> extends InteractionOptionsBase {
|
|
238
|
+
type: T;
|
|
239
|
+
value: number;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface InteractionOptionsBooleanValue<T extends InteractionOptionsBooleanTypes = InteractionOptionsBooleanTypes> extends InteractionOptionsBase {
|
|
243
|
+
type: T;
|
|
244
|
+
value: boolean;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
type InteractionOptionsStringTypes = ApplicationCommandOptionTypes.STRING | ApplicationCommandOptionTypes.USER | ApplicationCommandOptionTypes.CHANNEL | ApplicationCommandOptionTypes.ROLE | ApplicationCommandOptionTypes.MENTIONABLE | ApplicationCommandOptionTypes.ATTACHMENT;
|
|
248
|
+
type InteractionOptionsNumberTypes = ApplicationCommandOptionTypes.NUMBER | ApplicationCommandOptionTypes.INTEGER;
|
|
249
|
+
type InteractionOptionsBooleanTypes = ApplicationCommandOptionTypes.BOOLEAN;
|
|
250
|
+
|
|
251
|
+
export type InteractionOptionsString = InteractionOptionsStringValue<ApplicationCommandOptionTypes.STRING>;
|
|
252
|
+
export type InteractionOptionsInteger = InteractionOptionsNumberValue<ApplicationCommandOptionTypes.INTEGER>;
|
|
253
|
+
export type InteractionOptionsBoolean = InteractionOptionsBooleanValue<ApplicationCommandOptionTypes.BOOLEAN>;
|
|
254
|
+
export type InteractionOptionsUser = InteractionOptionsStringValue<ApplicationCommandOptionTypes.USER>;
|
|
255
|
+
export type InteractionOptionsChannel = InteractionOptionsStringValue<ApplicationCommandOptionTypes.CHANNEL>;
|
|
256
|
+
export type InteractionOptionsRole = InteractionOptionsStringValue<ApplicationCommandOptionTypes.ROLE>;
|
|
257
|
+
export type InteractionOptionsMentionable = InteractionOptionsStringValue<ApplicationCommandOptionTypes.MENTIONABLE>;
|
|
258
|
+
export type InteractionOptionsNumber = InteractionOptionsNumberValue<ApplicationCommandOptionTypes.NUMBER>;
|
|
259
|
+
export type InteractionOptionsAttachment = InteractionOptionsStringValue<ApplicationCommandOptionTypes.ATTACHMENT>;
|
|
260
|
+
|
|
261
|
+
export type AnyInteraction = PingInteraction | AnyInteractionGateway;
|
|
262
|
+
export type AnyInteractionGateway = AutocompleteInteraction | CommandInteraction | ComponentInteraction | ModalSubmitInteraction;
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
export interface AutocompleteChoice {
|
|
266
|
+
/** The name of the choice. */
|
|
267
|
+
name: string;
|
|
268
|
+
/** A dictionary of [locales](https://discord.com/developers/docs/reference#locales) to localized names. */
|
|
269
|
+
nameLocalizations?: LocaleMap;
|
|
270
|
+
/** The value of the choice. */
|
|
271
|
+
value: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
type Guildify<T extends Interaction> = Omit<T, "guild" | "guildID" | "guildLocale" | "guildPartial" | "member" | "memberPermissions"> & {
|
|
275
|
+
guild: Guild;
|
|
276
|
+
guildID: string;
|
|
277
|
+
guildLocale: string;
|
|
278
|
+
guildPartial: InteractionGuild;
|
|
279
|
+
member: Member;
|
|
280
|
+
memberPermissions: Permission;
|
|
281
|
+
};
|
|
282
|
+
type Privatify<T extends Interaction> = Omit<T, "guild" | "guildID" | "guildLocale" | "guildPartial" | "member" | "memberPermissions"> & {
|
|
283
|
+
guild: undefined;
|
|
284
|
+
guildID: undefined;
|
|
285
|
+
guildLocale: undefined;
|
|
286
|
+
guildPartial: undefined;
|
|
287
|
+
member: undefined;
|
|
288
|
+
memberPermissions: undefined;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export interface GuildAutocompleteInteraction extends Guildify<AutocompleteInteraction<AnyTextableGuildChannel>> {}
|
|
292
|
+
export interface PrivateAutocompleteInteraction extends Privatify<AutocompleteInteraction<AnyPrivateChannel | Uncached>> {}
|
|
293
|
+
export type AnyAutocompleteInteraction = GuildAutocompleteInteraction | PrivateAutocompleteInteraction;
|
|
294
|
+
|
|
295
|
+
export interface GuildCommandInteraction extends Guildify<CommandInteraction<AnyTextableGuildChannel>> {}
|
|
296
|
+
export interface PrivateCommandInteraction extends Privatify<CommandInteraction<AnyPrivateChannel | Uncached>> {}
|
|
297
|
+
export type AnyCommandInteraction = GuildCommandInteraction | PrivateCommandInteraction;
|
|
298
|
+
|
|
299
|
+
export interface GuildComponentButtonInteraction extends Guildify<ComponentInteraction<ComponentTypes.BUTTON, AnyTextableGuildChannel>> {}
|
|
300
|
+
export interface GuildComponentSelectMenuInteraction extends Guildify<ComponentInteraction<SelectMenuTypes, AnyTextableGuildChannel>> {}
|
|
301
|
+
export type GuildComponentInteraction = GuildComponentButtonInteraction | GuildComponentSelectMenuInteraction;
|
|
302
|
+
|
|
303
|
+
export interface PrivateComponentButtonInteraction extends Privatify<ComponentInteraction<ComponentTypes.BUTTON, AnyPrivateChannel | Uncached>> {}
|
|
304
|
+
export interface PrivateComponentSelectMenuInteraction extends Privatify<ComponentInteraction<SelectMenuTypes, AnyPrivateChannel | Uncached>> {}
|
|
305
|
+
export type PrivateComponentInteraction = PrivateComponentButtonInteraction | PrivateComponentSelectMenuInteraction;
|
|
306
|
+
export type AnyComponentButtonInteraction = GuildComponentButtonInteraction | PrivateComponentButtonInteraction;
|
|
307
|
+
export type AnyComponentSelectMenuInteraction = GuildComponentSelectMenuInteraction | PrivateComponentSelectMenuInteraction;
|
|
308
|
+
export type AnyComponentInteraction = AnyComponentButtonInteraction | AnyComponentSelectMenuInteraction;
|
|
309
|
+
|
|
310
|
+
export interface GuildModalSubmitInteraction extends Guildify<ModalSubmitInteraction<AnyTextableGuildChannel>> {}
|
|
311
|
+
export interface PrivateModalSubmitInteraction extends Privatify<ModalSubmitInteraction<AnyPrivateChannel | Uncached>> {}
|
|
312
|
+
export type AnyModalSubmitInteraction = GuildModalSubmitInteraction | PrivateModalSubmitInteraction;
|
|
313
|
+
|
|
314
|
+
export type SubCommandArray = [subcommand: string] | [subcommandGroup: string, subcommand: string];
|
|
315
|
+
export type AutoCompleteFocusedOption = InteractionOptionsString | InteractionOptionsNumber | InteractionOptionsInteger;
|
|
316
|
+
|
|
317
|
+
export interface InteractionGuild {
|
|
318
|
+
features: Array<GuildFeature>;
|
|
319
|
+
id: string;
|
|
320
|
+
locale: string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export type AnyGuildInteraction = GuildAutocompleteInteraction | GuildCommandInteraction | GuildComponentInteraction | GuildModalSubmitInteraction;
|
|
324
|
+
export type AnyPrivateInteraction = PrivateAutocompleteInteraction | PrivateCommandInteraction | PrivateComponentInteraction | PrivateModalSubmitInteraction;
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
export type SelectMenuDefaultValueTypes = "user" | "role" | "channel";
|
|
328
|
+
export interface SelectMenuDefaultValue {
|
|
329
|
+
id: string;
|
|
330
|
+
type: SelectMenuDefaultValueTypes;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
interface RawModalSubmitComponentsBase {
|
|
334
|
+
custom_id: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export interface RawModalSubmitComponentsStringValue<T extends ModalComponentTypes = ModalComponentTypes> extends RawModalSubmitComponentsBase {
|
|
338
|
+
type: T;
|
|
339
|
+
value: string;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface RawModalComponentsActionRow<T extends RawModalSubmitComponents> {
|
|
343
|
+
components: Array<T>;
|
|
344
|
+
type: ComponentTypes.ACTION_ROW;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
interface ModalComponentsActionRow<T extends ModalSubmitComponents> {
|
|
348
|
+
components: Array<T>;
|
|
349
|
+
type: ComponentTypes.ACTION_ROW;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export type ToModalSubmitComponentFromRaw<T extends RawModalSubmitComponents> =
|
|
353
|
+
T extends RawModalSubmitTextInputComponent ? ModalSubmitTextInputComponent :
|
|
354
|
+
never;
|
|
355
|
+
|
|
356
|
+
export type RawModalSubmitComponentsActionRow = RawModalComponentsActionRow<RawModalSubmitComponents>;
|
|
357
|
+
export type RawModalSubmitComponents = RawModalSubmitTextInputComponent;
|
|
358
|
+
export interface RawModalSubmitTextInputComponent extends RawModalSubmitComponentsStringValue<ComponentTypes.TEXT_INPUT> {}
|
|
359
|
+
|
|
360
|
+
interface ModalSubmitComponentsBase {
|
|
361
|
+
customID: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export interface ModalSubmitComponentsStringValue<T extends ModalComponentTypes = ModalComponentTypes> extends ModalSubmitComponentsBase {
|
|
365
|
+
type: T;
|
|
366
|
+
value: string;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export type ToRawFromoModalSubmitComponent<T extends ModalSubmitComponents> =
|
|
370
|
+
T extends ModalSubmitTextInputComponent ? RawModalSubmitTextInputComponent :
|
|
371
|
+
never;
|
|
372
|
+
|
|
373
|
+
export type ModalSubmitComponentsActionRow = ModalComponentsActionRow<ModalSubmitComponents>;
|
|
374
|
+
export type ModalSubmitComponents = ModalSubmitTextInputComponent;
|
|
375
|
+
export interface ModalSubmitTextInputComponent extends ModalSubmitComponentsStringValue<ComponentTypes.TEXT_INPUT> {}
|
|
376
|
+
|
|
377
|
+
export type ApplicationCommandTypesWithTarget = ApplicationCommandTypes.USER | ApplicationCommandTypes.MESSAGE;
|