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,448 +0,0 @@
1
- /** @module Types/Applications */
2
- import type { ImplementedChannels, InstallParams, RawOAuthGuild, RawUser } from ".";
3
- import type { ExclusifyUnion } from "./shared";
4
- import type { WithRequired } from "./misc";
5
- import type {
6
- ApplicationCommandOptionTypes,
7
- ApplicationCommandPermissionTypes,
8
- ApplicationCommandTypes,
9
- ApplicationIntegrationTypes,
10
- EntitlementOwnerTypes,
11
- EntitlementTypes,
12
- InteractionContextTypes,
13
- SKUAccessTypes,
14
- SKUTypes,
15
- TeamMembershipState
16
- } from "../Constants";
17
- import type ApplicationCommand from "../structures/ApplicationCommand";
18
- import type ClientApplication from "../structures/ClientApplication";
19
- import type User from "../structures/User";
20
-
21
- export interface RawApplication {
22
- approximate_guild_count?: number;
23
- bot_public?: boolean;
24
- bot_require_code_grant?: boolean;
25
- cover_image?: string;
26
- custom_install_url?: string;
27
- description: string;
28
- flags?: number;
29
- guild?: RawOAuthGuild;
30
- guild_id?: string;
31
- hook: boolean;
32
- icon: string | null;
33
- id: string;
34
- install_params?: InstallParams;
35
- integration_types?: Array<ApplicationIntegrationTypes>;
36
- integration_types_config?: Partial<Record<`${ApplicationIntegrationTypes}`, RawApplicationIntegrationConfig>>;
37
- interactions_endpoint_url?: string | null;
38
- name: string;
39
- owner?: RawUser;
40
- primary_sku_id?: string;
41
- privacy_policy_url?: string;
42
- redirect_uris?: Array<string>;
43
- role_connections_verification_url?: string | null;
44
- rpc_origins?: Array<string>;
45
- slug?: string;
46
- tags?: Array<string>;
47
- team?: RawTeam | null;
48
- terms_of_service_url?: string;
49
- type: number | null;
50
- verify_key: string;
51
- }
52
-
53
- export interface RawPartialApplication extends Pick<RawApplication, "id" | "name" | "icon" | "description">, Partial<Pick<RawApplication, "bot_public" | "bot_require_code_grant" | "verify_key">> {}
54
- export interface RESTOAuthApplication extends WithRequired<RawApplication, "cover_image" | "flags" | "owner" | "rpc_origins" | "install_params" | "integration_types" | "integration_types_config"> {}
55
- export interface RESTApplication extends WithRequired<RawApplication, "cover_image" | "flags" | "owner" | "rpc_origins" | "install_params" | "integration_types" | "integration_types_config"> {}
56
- export interface RawClientApplication extends Required<Pick<RawApplication, "id" | "flags">> {}
57
- export type TeamMemberRoleTypes = "admin" | "developer" | "read-only";
58
-
59
- export interface IntegrationTypesConfig extends Partial<Record<`${ApplicationIntegrationTypes}`, ApplicationIntegrationConfig>> {}
60
-
61
- export interface RawApplicationIntegrationConfig {
62
- oauth2_install_params?: InstallParams;
63
- }
64
-
65
- export interface ApplicationIntegrationConfig {
66
- oauth2InstallParams?: InstallParams;
67
- }
68
-
69
- export interface RawTeam {
70
- icon: string | null;
71
- id: string;
72
- members: Array<RawTeamMember>;
73
- name: string;
74
- owner_user_id: string;
75
- }
76
-
77
- export interface RawTeamMember {
78
- membership_state: TeamMembershipState;
79
- role: TeamMemberRoleTypes;
80
- team_id: string;
81
- user: RawUser;
82
- }
83
-
84
- export interface TeamMember {
85
- /** This member's [membership state](https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum) on this team. */
86
- membershipState: TeamMembershipState;
87
- /** The [role](https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types) of the team member. */
88
- role: TeamMemberRoleTypes;
89
- /** The id of the team this member is associated with. */
90
- teamID: string;
91
- /** The user associated with this team member. */
92
- user: User;
93
- }
94
-
95
- export interface RawApplicationCommand {
96
- application_id: string;
97
- contexts: Array<InteractionContextTypes>;
98
- default_member_permissions: string | null;
99
- description: string;
100
- description_localizations?: LocaleMap | null;
101
- description_localized?: string;
102
- dm_permission?: boolean;
103
- guild_id?: string;
104
- id: string;
105
- integration_types: Array<ApplicationIntegrationTypes>;
106
- name: string;
107
- name_localizations?: LocaleMap | null;
108
- name_localized?: string;
109
- nsfw?: boolean;
110
- options?: Array<RawApplicationCommandOption>;
111
- type: ApplicationCommandTypes;
112
- version: string;
113
- }
114
-
115
- export interface RawApplicationCommandOption {
116
- autocomplete?: boolean;
117
- channel_types?: Array<ImplementedChannels>;
118
- choices?: Array<RawApplicationCommandOptionChoice>;
119
- description: string;
120
- description_localizations?: LocaleMap | null;
121
- description_localized?: string;
122
- max_length?: number;
123
- max_value?: number;
124
- min_length?: number;
125
- min_value?: number;
126
- name: string;
127
- name_localizations?: LocaleMap | null;
128
- name_localized?: string;
129
- options?: Array<RawApplicationCommandOption>;
130
- required?: boolean;
131
- type: ApplicationCommandOptionTypes;
132
- }
133
-
134
- export interface CombinedApplicationCommandOption {
135
- autocomplete?: boolean;
136
- channelTypes?: Array<ImplementedChannels>;
137
- choices?: Array<ApplicationCommandOptionsChoices>;
138
- description: string;
139
- descriptionLocalizations?: LocaleMap | null;
140
- maxLength?: number;
141
- maxValue?: number;
142
- minLength?: number;
143
- minValue?: number;
144
- name: string;
145
- nameLocalizations?: LocaleMap | null;
146
- options?: Array<CombinedApplicationCommandOption>;
147
- required?: boolean;
148
- type: ApplicationCommandOptionTypes;
149
- }
150
-
151
- export interface RawApplicationCommandOptionChoice {
152
- name: string;
153
- name_localizations?: LocaleMap | null;
154
- value: string;
155
- }
156
-
157
- export type AnyApplicationCommand = ChatInputApplicationCommand | UserApplicationCommand | MessageApplicationCommand;
158
- export type ApplicationCommandOptions = ApplicationCommandOptionsWithOptions | ApplicationCommandOptionsWithValue;
159
- export type ApplicationCommandOptionsWithOptions = ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsSubCommandGroup;
160
- export type ApplicationCommandOptionsWithValue = ApplicationCommandOptionsString | ApplicationCommandOptionsInteger | ApplicationCommandOptionsBoolean | ApplicationCommandOptionsUser | ApplicationCommandOptionsChannel | ApplicationCommandOptionsRole | ApplicationCommandOptionsMentionable | ApplicationCommandOptionsNumber | ApplicationCommandOptionsAttachment;
161
- export type ChatInputApplicationCommand = ApplicationCommand<ApplicationCommandTypes.CHAT_INPUT>;
162
- export type UserApplicationCommand = ApplicationCommand<ApplicationCommandTypes.USER>;
163
- export type MessageApplicationCommand = ApplicationCommand<ApplicationCommandTypes.MESSAGE>;
164
-
165
- export type ApplicationCommandOptionConversion<T extends EditApplicationCommandOptions | CreateApplicationCommandOptions> =
166
- T extends EditChatInputApplicationCommandOptions | CreateChatInputApplicationCommandOptions ? ChatInputApplicationCommand :
167
- T extends EditUserApplicationCommandOptions | CreateUserApplicationCommandOptions ? UserApplicationCommand :
168
- T extends EditMessageApplicationCommandOptions | CreateMessageApplicationCommandOptions ? MessageApplicationCommand :
169
- never;
170
-
171
-
172
- export interface ApplicationCommandOptionBase<T extends ApplicationCommandOptionTypes = ApplicationCommandOptionTypes> {
173
- description: string;
174
- descriptionLocalizations?: LocaleMap;
175
- /** The description of this application command in the requested locale. This cannot be sent. */
176
- descriptionLocalized?: string;
177
- name: string;
178
- nameLocalizations?: LocaleMap;
179
- /** The description of this application command in the requested locale. This cannot be sent. */
180
- nameLocalized?: string;
181
- required?: T extends ApplicationCommandOptionTypes.SUB_COMMAND | ApplicationCommandOptionTypes.SUB_COMMAND_GROUP ? never : boolean;
182
- type: T;
183
- }
184
-
185
- type ApplicationCommandOptionsTypesWithAutocomplete = ApplicationCommandOptionTypes.INTEGER | ApplicationCommandOptionTypes.NUMBER | ApplicationCommandOptionTypes.STRING;
186
- type ApplicationCommandOptionsTypesWithChoices = ApplicationCommandOptionTypes.INTEGER | ApplicationCommandOptionTypes.NUMBER | ApplicationCommandOptionTypes.STRING;
187
-
188
- interface ApplicationCommandOptionsChoices<T extends ApplicationCommandOptionsTypesWithChoices = ApplicationCommandOptionsTypesWithChoices> {
189
- choices?: Array<ApplicationCommandOptionsChoice<T>>;
190
- }
191
-
192
- interface ApplicationCommandOptionsChoice<T extends ApplicationCommandOptionsTypesWithChoices = ApplicationCommandOptionsTypesWithChoices> {
193
- name: string;
194
- nameLocalizations?: LocaleMap;
195
- value:
196
- T extends ApplicationCommandOptionTypes.STRING ? string :
197
- T extends ApplicationCommandOptionTypes.INTEGER | ApplicationCommandOptionTypes.NUMBER ? number :
198
- unknown;
199
- }
200
-
201
- interface ApplicationCommandOptionsChannelTypes {
202
- channelTypes?: Array<ImplementedChannels>;
203
- }
204
-
205
- interface ApplicationCommandOptionsMinMaxValue {
206
- maxValue?: number;
207
- minValue?: number;
208
- }
209
-
210
- interface ApplicationCommandOptionsMinMaxLength {
211
- maxLength?: number;
212
- minLength?: number;
213
- }
214
-
215
- interface ApplicationCommandOptionsAutocomplete {
216
- autocomplete?: boolean;
217
- }
218
-
219
- interface ApplicationCommandOptionsSubCommand extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.SUB_COMMAND> {
220
- options?: Array<ApplicationCommandOptionsWithValue>;
221
- }
222
-
223
- interface ApplicationCommandOptionsSubCommandGroup extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.SUB_COMMAND_GROUP> {
224
- options?: Array<ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsWithValue>;
225
- }
226
-
227
- export interface ApplicationCommandOptionsAttachment extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.ATTACHMENT> {}
228
- export interface ApplicationCommandOptionsBoolean extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.BOOLEAN> {}
229
- export interface ApplicationCommandOptionsChannel extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.CHANNEL>, ApplicationCommandOptionsChannelTypes {}
230
- export type ApplicationCommandOptionsInteger = ApplicationCommandOptionBase<ApplicationCommandOptionTypes.INTEGER> & ExclusifyUnion<ApplicationCommandOptionsAutocomplete | ApplicationCommandOptionsMinMaxValue | ApplicationCommandOptionsChoices<ApplicationCommandOptionTypes.INTEGER>>;
231
- export interface ApplicationCommandOptionsMentionable extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.MENTIONABLE> {}
232
- export type ApplicationCommandOptionsNumber = ApplicationCommandOptionBase<ApplicationCommandOptionTypes.NUMBER> & ExclusifyUnion<ApplicationCommandOptionsAutocomplete | ApplicationCommandOptionsMinMaxValue | ApplicationCommandOptionsChoices<ApplicationCommandOptionTypes.NUMBER>>;
233
- export interface ApplicationCommandOptionsRole extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.ROLE> {}
234
- export type ApplicationCommandOptionsString = ApplicationCommandOptionBase<ApplicationCommandOptionTypes.STRING> & ExclusifyUnion<ApplicationCommandOptionsAutocomplete | ApplicationCommandOptionsMinMaxLength | ApplicationCommandOptionsChoices<ApplicationCommandOptionTypes.STRING>>;
235
- export interface ApplicationCommandOptionsUser extends ApplicationCommandOptionBase<ApplicationCommandOptionTypes.USER> {}
236
-
237
- // desc, options
238
- export interface CreateApplicationCommandOptionsBase<T extends ApplicationCommandTypes = ApplicationCommandTypes> {
239
- /** The interaction contexts where the command can be used. Defaults to all interaction context types for new commands. */
240
- contexts?: Array<InteractionContextTypes>;
241
- /** The default member permissions for the command. */
242
- defaultMemberPermissions?: string | null;
243
- /**
244
- * If the command can be used in a DM.
245
- * @deprecated Use contexts instead.
246
- */
247
- dmPermission?: boolean | null;
248
- /** The ID of the command, if known. (Only usable when bulkEditing guild commands.) */
249
- id?: string;
250
- /** The install contexts where the command is available. Defaults to {@link Constants~ApplicationIntegrationTypes.GUILD_INSTALL | GUILD_INSTALL}. */
251
- integrationTypes?: Array<ApplicationIntegrationTypes>;
252
- /** The name of the command. */
253
- name: string;
254
- /** A dictionary of [locales](https://discord.com/developers/docs/reference#locales) to localized names. */
255
- nameLocalizations?: LocaleMap | null;
256
- /** Whether the command is age restricted. */
257
- nsfw?: boolean;
258
- /** The type of the command. */
259
- type: T;
260
- }
261
-
262
- export type CreateApplicationCommandOptions = CreateChatInputApplicationCommandOptions | CreateUserApplicationCommandOptions | CreateMessageApplicationCommandOptions;
263
- export interface CreateGuildChatInputApplicationCommandOptions extends Omit<CreateChatInputApplicationCommandOptions, "dmPermission" | "integrationTypes" | "contexts"> {}
264
- export interface CreateGuildUserApplicationCommandOptions extends Omit<CreateUserApplicationCommandOptions, "dmPermission" | "integrationTypes" | "contexts"> {}
265
- export interface CreateGuildMessageApplicationCommandOptions extends Omit<CreateMessageApplicationCommandOptions, "dmPermission" | "integrationTypes" | "contexts"> {}
266
- export type CreateGuildApplicationCommandOptions = CreateGuildChatInputApplicationCommandOptions | CreateGuildUserApplicationCommandOptions | CreateGuildMessageApplicationCommandOptions;
267
- export interface CreateChatInputApplicationCommandOptions extends CreateApplicationCommandOptionsBase<ApplicationCommandTypes.CHAT_INPUT> {
268
- /** The description of the command. */
269
- description: string;
270
- /** A dictionary of [locales](https://discord.com/developers/docs/reference#locales) to localized descriptions. */
271
- descriptionLocalizations?: LocaleMap | null;
272
- /** See [Discord's docs](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure) for more information. Convert `snake_case` keys to `camelCase`. */
273
- options?: Array<ApplicationCommandOptions>;
274
- }
275
-
276
- export type CreateUserApplicationCommandOptions = CreateApplicationCommandOptionsBase<ApplicationCommandTypes.USER>;
277
- export type CreateMessageApplicationCommandOptions = CreateApplicationCommandOptionsBase<ApplicationCommandTypes.MESSAGE>;
278
-
279
- export type EditApplicationCommandOptions = EditChatInputApplicationCommandOptions | EditUserApplicationCommandOptions | EditMessageApplicationCommandOptions;
280
- export interface EditChatInputApplicationCommandOptions extends Partial<Omit<CreateChatInputApplicationCommandOptions, "type">> {}
281
- export interface EditUserApplicationCommandOptions extends Partial<Omit<CreateUserApplicationCommandOptions, "type">> {}
282
- export interface EditMessageApplicationCommandOptions extends Partial<Omit<CreateMessageApplicationCommandOptions, "type">> {}
283
-
284
- export type EditGuildApplicationCommandOptions = EditGuildChatInputApplicationCommandOptions | EditGuildUserApplicationCommandOptions | EditGuildMessageApplicationCommandOptions;
285
- export interface EditGuildChatInputApplicationCommandOptions extends Partial<Omit<CreateChatInputApplicationCommandOptions, "type" | "dmPermission" | "integrationTypes" | "contexts">> {}
286
- export interface EditGuildUserApplicationCommandOptions extends Partial<Omit<CreateUserApplicationCommandOptions, "type" | "dmPermission" | "integrationTypes" | "contexts">> {}
287
- export interface EditGuildMessageApplicationCommandOptions extends Partial<Omit<CreateMessageApplicationCommandOptions, "type" | "dmPermission" | "integrationTypes" | "contexts">> {}
288
-
289
- export interface RawGuildApplicationCommandPermissions {
290
- application_id: string;
291
- guild_id: string;
292
- id: string;
293
- permissions: Array<ApplicationCommandPermission>;
294
- }
295
-
296
- export interface RESTGuildApplicationCommandPermissions {
297
- applicationID: string;
298
- guildID: string;
299
- id: string;
300
- permissions: Array<ApplicationCommandPermission>;
301
- }
302
- export interface GuildApplicationCommandPermissions {
303
- application?: ClientApplication;
304
- applicationID: string;
305
- id: string;
306
- permissions: Array<ApplicationCommandPermission>;
307
- }
308
-
309
- export interface ApplicationCommandPermission {
310
- /** The id of the role, user, channel, or a [permission constant](https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants). */
311
- id: string;
312
- /** If the permission is allowed. */
313
- permission: boolean;
314
- /** The [type](https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type) of permission */
315
- type: ApplicationCommandPermissionTypes;
316
- }
317
-
318
- export interface EditApplicationCommandPermissionsOptions {
319
- /** If the overall authorization of this rest instance is not a bearer token, a bearer token can be supplied via this option. */
320
- accessToken?: string;
321
- /** The permissions to set for the command. */
322
- permissions: Array<ApplicationCommandPermission>;
323
- }
324
-
325
- export type TypeToEdit<T extends ApplicationCommandTypes> =
326
- T extends ApplicationCommandTypes.CHAT_INPUT ? EditChatInputApplicationCommandOptions :
327
- T extends ApplicationCommandTypes.USER ? EditUserApplicationCommandOptions :
328
- T extends ApplicationCommandTypes.MESSAGE ? EditMessageApplicationCommandOptions :
329
- never;
330
-
331
-
332
- export interface GetApplicationCommandOptions {
333
- /** The [locale](https://discord.com/developers/docs/reference#locales) to receive localized responses for (`descriptionLocalized`, `nameLocalized`). If no localization for the locale is present, the properties will not be present. */
334
- locale?: string;
335
- /** If localizations should be included. */
336
- withLocalizations?: boolean;
337
- }
338
-
339
- export type Locale =
340
- "bg" |
341
- "cs" |
342
- "da" |
343
- "de" |
344
- "el" |
345
- "en-GB" |
346
- "en-US" |
347
- "es-ES" |
348
- "fi" |
349
- "fr" |
350
- "hi" |
351
- "hr" |
352
- "hu" |
353
- "id" |
354
- "it" |
355
- "ja" |
356
- "ko" |
357
- "lt" |
358
- "nl" |
359
- "no" |
360
- "pl" |
361
- "pt-BR" |
362
- "ro" |
363
- "ru" |
364
- "sv-SE" |
365
- "th" |
366
- "tr" |
367
- "uk" |
368
- "vi" |
369
- "zh-CN" |
370
- "zh-TW";
371
- export type LocaleMap = Partial<Record<Locale, string>>;
372
-
373
- export interface CreateTestEntitlementOptions {
374
- /** The ID of the owner of the test entitlement, a user or guild.*/
375
- ownerID: string;
376
- /** The type of the owner of the entitlement. */
377
- ownerType: EntitlementOwnerTypes;
378
- /** The ID of the SKU to create an entitlement for. */
379
- skuID: string;
380
- }
381
-
382
- export interface RawBaseEntitlement {
383
- application_id: string;
384
- consumed: boolean;
385
- deleted: boolean;
386
- gift_code_flags: number;
387
- guild_id: string | null;
388
- id: string;
389
- promotion_id: string | null;
390
- sku_id: string;
391
- type: EntitlementTypes;
392
- user_id: string | null;
393
- }
394
-
395
- export interface RawEntitlement extends RawBaseEntitlement {
396
- ends_at: string;
397
- starts_at: string;
398
- subscription_id: string;
399
- }
400
-
401
- export interface RawTestEntitlement extends RawBaseEntitlement {}
402
-
403
- export interface SearchEntitlementsOptions {
404
- after?: string;
405
- before?: string;
406
- excludeEnded?: boolean;
407
- guildID?: string;
408
- limit?: number;
409
- skuIDs?: Array<string>;
410
- userID?: string;
411
- }
412
-
413
- export interface RawSKU {
414
- access_type: SKUAccessTypes; // undocumented, guessed
415
- application_id: string;
416
- dependent_sku_id: string | null;
417
- features: []; // undocumented
418
- flags: number;
419
- id: string;
420
- manifest_labels: null; // undocumented
421
- name: string;
422
- release_date: null; // undocumented
423
- show_age_gate: boolean;
424
- slug: string;
425
- type: SKUTypes;
426
- }
427
-
428
- export interface EditApplicationOptions {
429
- /** The cover image for the application. */
430
- coverImage?: string | Buffer | null;
431
- /** The default authorization url shown in Discord. */
432
- customInstallURL?: string;
433
- /** The description of the application. */
434
- description?: string;
435
- /** The [public flags](https://discord.com/developers/docs/resources/application#application-object-application-flags) of the application. */
436
- flags?: number;
437
- /** The icon for the application. */
438
- icon?: string | Buffer | null;
439
- /** The install parameters of the application. */
440
- installParams?: InstallParams;
441
- integrationTypesConfig?: IntegrationTypesConfig;
442
- /** The url where the application receives interactions. Must be valid according to Discord's [Receiving an interaction](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction) documentation. */
443
- interactionsEndpointURL?: string;
444
- /** The role connection verification url for the application. */
445
- roleConnectionsVerificationURL?: string;
446
- /** The tags for the application. Max 5 per application, 20 characters each. */
447
- tags?: Array<string>;
448
- }
@@ -1,121 +0,0 @@
1
- /** @module Types/AuditLog */
2
- import type { RawAutoModerationRule } from "./auto-moderation";
3
- import type { RawAnnouncementThreadChannel, RawPrivateThreadChannel, RawPublicThreadChannel } from "./channels";
4
- import type { RawIntegration } from "./guilds";
5
- import type { RawScheduledEvent } from "./scheduled-events";
6
- import type { RawUser } from "./users";
7
- import type { RawWebhook } from "./webhooks";
8
- import type { RawApplicationCommand } from "./applications";
9
- import type { AuditLogActionTypes } from "../Constants";
10
- import type GuildScheduledEvent from "../structures/GuildScheduledEvent";
11
- import type AnnouncementThreadChannel from "../structures/AnnouncementThreadChannel";
12
- import type PublicThreadChannel from "../structures/PublicThreadChannel";
13
- import type PrivateThreadChannel from "../structures/PrivateThreadChannel";
14
- import type User from "../structures/User";
15
- import type Webhook from "../structures/Webhook";
16
- import type Integration from "../structures/Integration";
17
- import type AutoModerationRule from "../structures/AutoModerationRule";
18
- import type AuditLogEntry from "../structures/AuditLogEntry";
19
- import type ApplicationCommand from "../structures/ApplicationCommand";
20
-
21
- export interface RawAuditLog {
22
- application_commands: Array<RawApplicationCommand>;
23
- audit_log_entries: Array<RawAuditLogEntry>;
24
- auto_moderation_rules: Array<RawAutoModerationRule>;
25
- guild_scheduled_events: Array<RawScheduledEvent>;
26
- integrations: Array<RawIntegration>;
27
- threads: Array<RawAnnouncementThreadChannel | RawPublicThreadChannel | RawPrivateThreadChannel>;
28
- users: Array<RawUser>;
29
- webhooks: Array<RawWebhook>;
30
- }
31
-
32
- export interface AuditLog {
33
- applicationCommands: Array<ApplicationCommand>;
34
- autoModerationRules: Array<AutoModerationRule>;
35
- entries: Array<AuditLogEntry>;
36
- guildScheduledEvents: Array<GuildScheduledEvent>;
37
- integrations: Array<Integration>;
38
- threads: Array<AnnouncementThreadChannel | PublicThreadChannel | PrivateThreadChannel>;
39
- users: Array<User>;
40
- webhooks: Array<Webhook>;
41
- }
42
-
43
- export interface RawAuditLogEntry {
44
- action_type: AuditLogActionTypes;
45
- /** See the [audit log documentation](https://discord.com/developers/docs/resources/audit-log#audit-log-change-object) for more information. */
46
- changes?: Array<StandardAuditLogChange | RoleAuditLogChange>;
47
- id: string;
48
- options?: RawAuditLogEntryOptions;
49
- reason?: string;
50
- target_id: string | null;
51
- user_id: string | null;
52
- }
53
- export interface RawAuditLogEntryOptions {
54
- application_id?: string;
55
- auto_moderation_rule_name?: string;
56
- auto_moderation_rule_trigger_type?: string;
57
- channel_id?: string;
58
- count?: number;
59
- delete_member_days?: number;
60
- id?: string;
61
- integration_type?: string;
62
- members_removed?: number;
63
- message_id?: string;
64
- role_name?: string;
65
- status?: string;
66
- type?: "0" | "1";
67
- }
68
- export interface AuditLogEntryOptions {
69
- /** ID of the app whose permissions were targeted - valid for: `APPLICATION_COMMAND_PERMISSION_UPDATE` */
70
- applicationID?: string;
71
- /** Name of the auto moderation rule that was triggered - valid for: `AUTO_MODERATION_BLOCK_MESSAGE`, `AUTO_MODERATION_FLAG_TO_CHANNEL`, `AUTO_MODERATION_USER_COMMUNICATION_DISABLED` */
72
- autoModerationRuleName?: string;
73
- /** Trigger type of the auto moderation rule that was triggered - valid for: `AUTO_MODERATION_BLOCK_MESSAGE`, `AUTO_MODERATION_FLAG_TO_CHANNEL`, `AUTO_MODERATION_USER_COMMUNICATION_DISABLED` */
74
- autoModerationRuleTriggerType?: string;
75
- /** Channel in which the entities were targeted - valid for: `MEMBER_MOVE`, `MESSAGE_PIN`, `MESSAGE_UNPIN`, `MESSAGE_DELETE`, `STAGE_INSTANCE_CREATE`, `STAGE_INSTANCE_UPDATE`, `STAGE_INSTANCE_DELETE` */
76
- channelID?: string;
77
- /** Number of entities that were targeted - valid for: `MESSAGE_DELETE`, `MESSAGE_BULK_DELETE`, `MEMBER_DISCONNECT`, `MEMBER_MOVE` */
78
- count?: number;
79
- /** Number of days after which inactive members were kicked - valid for: `MEMBER_PRUNE` */
80
- deleteMemberDays?: number;
81
- /** ID of the overwritten entity - valid for: `CHANNEL_OVERWRITE_CREATE`, `CHANNEL_OVERWRITE_UPDATE`, `CHANNEL_OVERWRITE_DELETE` */
82
- id?: string;
83
- /** The type of interaction - valid for: `MEMBER_KICK`, `MEMBER_ROLE_UPDATE` */
84
- integrationType?: string;
85
- /** Number of members removed by the prune - valid for: `MEMBER_PRUNE` */
86
- membersRemoved?: number;
87
- /** ID of the message that was targeted - valid for: `MESSAGE_PIN`, `MESSAGE_UNPIN` */
88
- messageID?: string;
89
- /** Name of the role if type is "0" (not present if type is "1") - valid for: `CHANNEL_OVERWRITE_CREATE`, `CHANNEL_OVERWRITE_UPDATE`, `CHANNEL_OVERWRITE_DELETE` */
90
- roleName?: string;
91
- /** The status set in a voice channel - valid for: `VOICE_CHANNEL_STATUS_CREATE` */
92
- status?: string;
93
- /** Type of overwritten entity - role ("0") or member ("1") - valid for: `CHANNEL_OVERWRITE_CREATE`, `CHANNEL_OVERWRITE_UPDATE`, `CHANNEL_OVERWRITE_DELETE` */
94
- type?: "0" | "1";
95
- }
96
-
97
- export interface RawAuditLogIntegration extends Pick<RawIntegration, "id" | "name" | "type" | "account"> {
98
- application_id?: string;
99
- }
100
-
101
- export interface StandardAuditLogChange {
102
- key: string;
103
- new_value?: unknown;
104
- old_value?: unknown;
105
- }
106
-
107
- export interface RoleAuditLogChange {
108
- key: "$add" | "$remove";
109
- new_value: Array<{ id: string; name: string; }>;
110
- }
111
-
112
- export interface GetAuditLogOptions {
113
- /** The action type to filter by. */
114
- actionType?: AuditLogActionTypes;
115
- /** The ID of the entry to get entries before. */
116
- before?: string;
117
- /** The maximum number of entries to get. */
118
- limit?: number;
119
- /** The ID of the user to filter by. */
120
- userID?: string;
121
- }
@@ -1,99 +0,0 @@
1
- /** @module Types/AutoModeration */
2
- import type { AutoModerationActionTypes, AutoModerationEventTypes, AutoModerationKeywordPresetTypes, AutoModerationTriggerTypes } from "../Constants";
3
-
4
- export interface RawAutoModerationRule {
5
- actions: Array<RawAutoModerationAction>;
6
- creator_id: string;
7
- enabled: boolean;
8
- event_type: AutoModerationEventTypes;
9
- exempt_channels: Array<string>;
10
- exempt_roles: Array<string>;
11
- guild_id: string;
12
- id: string;
13
- name: string;
14
- trigger_metadata: RawTriggerMetadata;
15
- trigger_type: AutoModerationTriggerTypes;
16
- }
17
-
18
- export interface RawTriggerMetadata {
19
- /** `KEYWORD`, `KEYWORD_PRESET`, `MEMBER_PROFILE` */
20
- allow_list?: Array<string>;
21
- /** `KEYWORD`, `MEMBER_PROFILE` */
22
- keyword_filter?: Array<string>;
23
- /** `MENTION_SPAM` */
24
- mention_raid_protection_enabled?: boolean;
25
- /** `MENTION_SPAM` */
26
- mention_total_limit?: number;
27
- /** `KEYWORD_PRESET` */
28
- presets?: Array<AutoModerationKeywordPresetTypes>;
29
- /** `KEYWORD`, `MEMBER_PROFILE` */
30
- regex_patterns?: Array<string>;
31
- }
32
-
33
- export interface RawAutoModerationAction {
34
- metadata: RawActionMetadata;
35
- type: AutoModerationActionTypes;
36
- }
37
-
38
- export interface RawActionMetadata {
39
- /** `SEND_ALERT_MESSAGE` */
40
- channel_id?: string;
41
- /** `BLOCK_MESSAGE` */
42
- custom_message?: string;
43
- /** `TIMEOUT` */
44
- duration_seconds?: number;
45
- }
46
-
47
- export interface TriggerMetadata {
48
- /** The keywords to allow. Valid for `KEYWORD`, `KEYWORD_PRESET` & `MEMBER_PROFILE`. `KEYWORD`, `MEMBER_PROFILE`: Max 100 total, 60 characters each. `KEYWORD_PRESET`: Max 1000 total, 60 characters each. */
49
- allowList?: Array<string>;
50
- /** The keywords to filter. Valid for `KEYWORD` & `MEMBER_PROFILE`. Max 1000 total, 60 characters each. */
51
- keywordFilter?: Array<string>;
52
- /** Whether to enable mention raid protection. Valid for `MENTION_SPAM`. */
53
- mentionRaidProtectionEnabled?: boolean;
54
- /** The maximum number of mentions to allow. Valid for `MENTION_SPAM`. */
55
- mentionTotalLimit?: number;
56
- /** The presets to use. Valid for `KEYWORD_PRESET`. */
57
- presets?: Array<AutoModerationKeywordPresetTypes>;
58
- /** The regular expressions to match the content against and filter. Currently only Rust flavored regex such as `Rustexp` are supported. Valid for `KEYWORD`& `MEMBER_PROFILE`. Max 10 total, 260 characters each. */
59
- regexPatterns?: Array<string>;
60
- }
61
-
62
- export interface AutoModerationAction {
63
- /** The metadata for the action. */
64
- metadata: ActionMetadata;
65
- /** The type of the action. */
66
- type: AutoModerationActionTypes;
67
- }
68
-
69
- export interface ActionMetadata {
70
- /** The ID of the channel to send the message to. Valid for `SEND_ALERT_MESSAGE`. */
71
- channelID?: string;
72
- /** The custom message to send. Valid for `BLOCK_MESSAGE`. */
73
- customMessage?: string;
74
- /** The duration of the timeout in seconds. Valid for `TIMEOUT`. */
75
- durationSeconds?: number;
76
- }
77
-
78
- export interface CreateAutoModerationRuleOptions {
79
- /** The actions for the rule. */
80
- actions: Array<AutoModerationAction>;
81
- /** If the rule is enabled. */
82
- enabled?: boolean;
83
- /** The event type to trigger on. */
84
- eventType: AutoModerationEventTypes;
85
- /** The channels to exempt from the rule. */
86
- exemptChannels?: Array<string>;
87
- /** The roles to exempt from the rule. */
88
- exemptRoles?: Array<string>;
89
- /** The name of the rule. */
90
- name: string;
91
- /** The reason for creating the rule. */
92
- reason?: string;
93
- /** The metadata to use for the trigger. */
94
- triggerMetadata?: TriggerMetadata;
95
- /** The type of trigger to use. */
96
- triggerType: AutoModerationTriggerTypes;
97
- }
98
-
99
- export type EditAutoModerationRuleOptions = Partial<Pick<CreateAutoModerationRuleOptions, "name" | "eventType" | "triggerMetadata" | "actions" | "enabled" | "exemptRoles" | "exemptChannels" | "reason">>;