oceanic.js 1.10.1-dev.97cef9c → 1.10.1-dev.9b37972

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