dfx 0.91.1 → 0.91.3
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/DiscordGateway/Shard.d.ts +2 -2
- package/DiscordGateway/Sharder.d.ts +1 -1
- package/DiscordGateway.d.ts +1 -1
- package/DiscordREST.d.ts +1 -1
- package/Interactions/context.d.ts +1 -1
- package/Interactions/definitions.d.ts +6 -5
- package/Interactions/definitions.d.ts.map +1 -1
- package/Interactions/definitions.js.map +1 -1
- package/Interactions/gateway.d.ts.map +1 -1
- package/Interactions/gateway.js +6 -2
- package/Interactions/gateway.js.map +1 -1
- package/Interactions/handlers.d.ts +2 -1
- package/Interactions/handlers.d.ts.map +1 -1
- package/Interactions/handlers.js.map +1 -1
- package/Interactions/utils.d.ts +5 -5
- package/Interactions/utils.d.ts.map +1 -1
- package/Interactions/utils.js +1 -1
- package/Interactions/utils.js.map +1 -1
- package/Interactions/webhook.d.ts.map +1 -1
- package/Interactions/webhook.js +5 -1
- package/Interactions/webhook.js.map +1 -1
- package/mjs/Interactions/definitions.mjs.map +1 -1
- package/mjs/Interactions/gateway.mjs +6 -2
- package/mjs/Interactions/gateway.mjs.map +1 -1
- package/mjs/Interactions/handlers.mjs.map +1 -1
- package/mjs/Interactions/utils.mjs +1 -1
- package/mjs/Interactions/utils.mjs.map +1 -1
- package/mjs/Interactions/webhook.mjs +5 -1
- package/mjs/Interactions/webhook.mjs.map +1 -1
- package/mjs/types.mjs +22 -0
- package/mjs/types.mjs.map +1 -1
- package/mjs/version.mjs +1 -1
- package/package.json +2 -2
- package/src/Interactions/builder.ts +1 -1
- package/src/Interactions/definitions.ts +9 -5
- package/src/Interactions/gateway.ts +8 -3
- package/src/Interactions/handlers.ts +6 -5
- package/src/Interactions/utils.ts +13 -11
- package/src/Interactions/webhook.ts +8 -4
- package/src/types.ts +97 -10
- package/src/version.ts +1 -1
- package/types.d.ts +86 -10
- package/types.d.ts.map +1 -1
- package/types.js +23 -1
- package/types.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/src/types.ts
CHANGED
|
@@ -200,6 +200,8 @@ export interface Application {
|
|
|
200
200
|
readonly tags?: Array<string>
|
|
201
201
|
/** Settings for the app's default in-app authorization link, if enabled */
|
|
202
202
|
readonly install_params?: InstallParam
|
|
203
|
+
/** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
|
|
204
|
+
readonly integration_types_config?: ApplicationIntegrationType
|
|
203
205
|
/** Default custom authorization URL for the app, if enabled */
|
|
204
206
|
readonly custom_install_url?: string
|
|
205
207
|
}
|
|
@@ -224,12 +226,16 @@ export interface ApplicationCommand {
|
|
|
224
226
|
readonly options?: Array<ApplicationCommandOption>
|
|
225
227
|
/** Set of permissions represented as a bit set */
|
|
226
228
|
readonly default_member_permissions?: string | null
|
|
227
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
229
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
228
230
|
readonly dm_permission?: boolean
|
|
229
231
|
/** Not recommended for use as field will soon be deprecated. Indicates whether the command is enabled by default when the app is added to a guild, defaults to true */
|
|
230
232
|
readonly default_permission?: boolean | null
|
|
231
233
|
/** Indicates whether the command is age-restricted, defaults to false */
|
|
232
234
|
readonly nsfw?: boolean
|
|
235
|
+
/** In preview. Installation context(s) where the command is available, only for globally-scoped commands. Defaults to GUILD_INSTALL (0) */
|
|
236
|
+
readonly integration_types?: Array<ApplicationIntegrationType>
|
|
237
|
+
/** In preview. Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands. */
|
|
238
|
+
readonly contexts?: Array<InteractionContextType> | null
|
|
233
239
|
/** Autoincrementing version identifier updated during substantial record changes */
|
|
234
240
|
readonly version: Snowflake
|
|
235
241
|
}
|
|
@@ -357,6 +363,12 @@ export const ApplicationFlag = {
|
|
|
357
363
|
/** Indicates if an app has registered global application commands */
|
|
358
364
|
APPLICATION_COMMAND_BADGE: 1 << 23,
|
|
359
365
|
} as const
|
|
366
|
+
export enum ApplicationIntegrationType {
|
|
367
|
+
/** App is installable to servers */
|
|
368
|
+
GUILD_INSTALL = 0,
|
|
369
|
+
/** App is installable to users */
|
|
370
|
+
USER_INSTALL = 1,
|
|
371
|
+
}
|
|
360
372
|
export interface ApplicationRoleConnection {
|
|
361
373
|
/** the vanity name of the platform a bot has connected (max 50 characters) */
|
|
362
374
|
readonly platform_name?: string | null
|
|
@@ -684,10 +696,28 @@ export interface BeginGuildPruneParams {
|
|
|
684
696
|
/** reason for the prune (deprecated) */
|
|
685
697
|
readonly reason?: string
|
|
686
698
|
}
|
|
699
|
+
export interface BulkBanResponse {
|
|
700
|
+
/** list of user ids, that were successfully banned */
|
|
701
|
+
readonly banned_users: Array<Snowflake>
|
|
702
|
+
/** list of user ids, that were not banned */
|
|
703
|
+
readonly failed_users: Array<Snowflake>
|
|
704
|
+
}
|
|
687
705
|
export interface BulkDeleteMessageParams {
|
|
688
706
|
/** an array of message ids to delete (2-100) */
|
|
689
707
|
readonly messages: Array<Snowflake>
|
|
690
708
|
}
|
|
709
|
+
export interface BulkGuildBanParams {
|
|
710
|
+
/** list of user ids to ban (max 200) */
|
|
711
|
+
readonly user_ids: Array<Snowflake>
|
|
712
|
+
/** number of seconds to delete messages for, between 0 and 604800 (7 days) */
|
|
713
|
+
readonly delete_message_seconds?: number
|
|
714
|
+
}
|
|
715
|
+
export interface BulkGuildBanResponse {
|
|
716
|
+
/** list of user ids, that were successfully banned */
|
|
717
|
+
readonly banned_users: Array<Snowflake>
|
|
718
|
+
/** list of user ids, that were not banned */
|
|
719
|
+
readonly failed_users: Array<Snowflake>
|
|
720
|
+
}
|
|
691
721
|
export interface BulkOverwriteGuildApplicationCommandParams {
|
|
692
722
|
/** ID of the command, if known */
|
|
693
723
|
readonly id?: Snowflake
|
|
@@ -703,10 +733,14 @@ export interface BulkOverwriteGuildApplicationCommandParams {
|
|
|
703
733
|
readonly options?: Array<ApplicationCommandOption>
|
|
704
734
|
/** Set of permissions represented as a bit set */
|
|
705
735
|
readonly default_member_permissions?: string | null
|
|
706
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
736
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
707
737
|
readonly dm_permission?: boolean | null
|
|
708
738
|
/** Replaced by default_member_permissions and will be deprecated in the future. Indicates whether the command is enabled by default when the app is added to a guild. Defaults to true */
|
|
709
739
|
readonly default_permission?: boolean
|
|
740
|
+
/** In preview. Installation context(s) where the command is available, defaults to GUILD_INSTALL ([0]) */
|
|
741
|
+
readonly integration_types: Array<ApplicationIntegrationType>
|
|
742
|
+
/** In preview. Interaction context(s) where the command can be used, defaults to all contexts [0,1,2] */
|
|
743
|
+
readonly contexts: Array<InteractionContextType>
|
|
710
744
|
/** Type of command, defaults 1 if not set */
|
|
711
745
|
readonly type?: ApplicationCommandType
|
|
712
746
|
/** Indicates whether the command is age-restricted */
|
|
@@ -964,10 +998,14 @@ export interface CreateGlobalApplicationCommandParams {
|
|
|
964
998
|
readonly options?: Array<ApplicationCommandOption>
|
|
965
999
|
/** Set of permissions represented as a bit set */
|
|
966
1000
|
readonly default_member_permissions?: string | null
|
|
967
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
1001
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
968
1002
|
readonly dm_permission?: boolean | null
|
|
969
1003
|
/** Replaced by default_member_permissions and will be deprecated in the future. Indicates whether the command is enabled by default when the app is added to a guild. Defaults to true */
|
|
970
1004
|
readonly default_permission?: boolean
|
|
1005
|
+
/** Installation context(s) where the command is available */
|
|
1006
|
+
readonly integration_types?: Array<ApplicationIntegrationType>
|
|
1007
|
+
/** Interaction context(s) where the command can be used */
|
|
1008
|
+
readonly contexts?: Array<InteractionContextType>
|
|
971
1009
|
/** Type of command, defaults 1 if not set */
|
|
972
1010
|
readonly type?: ApplicationCommandType
|
|
973
1011
|
/** Indicates whether the command is age-restricted */
|
|
@@ -1156,7 +1194,7 @@ export interface CreateMessageParams {
|
|
|
1156
1194
|
readonly files?: string
|
|
1157
1195
|
/** JSON-encoded body of non-file params, only for multipart/form-data requests. See Uploading Files */
|
|
1158
1196
|
readonly payload_json?: string
|
|
1159
|
-
/** Attachment objects with filename and description. See
|
|
1197
|
+
/** Attachment objects with filename and description. See Uploading Files */
|
|
1160
1198
|
readonly attachments?: Array<Attachment>
|
|
1161
1199
|
/** Message flags combined as a bitfield (only SUPPRESS_EMBEDS and SUPPRESS_NOTIFICATIONS can be set) */
|
|
1162
1200
|
readonly flags?: number
|
|
@@ -1206,6 +1244,13 @@ export function createRoutes<O = any>(
|
|
|
1206
1244
|
params,
|
|
1207
1245
|
options,
|
|
1208
1246
|
}),
|
|
1247
|
+
bulkGuildBan: (guildId, params, options) =>
|
|
1248
|
+
fetch({
|
|
1249
|
+
method: "POST",
|
|
1250
|
+
url: `/guilds/${guildId}/bulk-ban`,
|
|
1251
|
+
params,
|
|
1252
|
+
options,
|
|
1253
|
+
}),
|
|
1209
1254
|
bulkOverwriteGlobalApplicationCommands: (applicationId, options) =>
|
|
1210
1255
|
fetch({
|
|
1211
1256
|
method: "PUT",
|
|
@@ -2508,6 +2553,8 @@ export interface EditCurrentApplicationParams {
|
|
|
2508
2553
|
readonly role_connections_verification_url: string
|
|
2509
2554
|
/** Settings for the app's default in-app authorization link, if enabled */
|
|
2510
2555
|
readonly install_params: InstallParam
|
|
2556
|
+
/** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
|
|
2557
|
+
readonly integration_types_config: ApplicationIntegrationType
|
|
2511
2558
|
/** App's public flags */
|
|
2512
2559
|
readonly flags: number
|
|
2513
2560
|
/** Icon for the app */
|
|
@@ -2532,10 +2579,14 @@ export interface EditGlobalApplicationCommandParams {
|
|
|
2532
2579
|
readonly options?: Array<ApplicationCommandOption>
|
|
2533
2580
|
/** Set of permissions represented as a bit set */
|
|
2534
2581
|
readonly default_member_permissions?: string | null
|
|
2535
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
2582
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
2536
2583
|
readonly dm_permission?: boolean | null
|
|
2537
2584
|
/** Replaced by default_member_permissions and will be deprecated in the future. Indicates whether the command is enabled by default when the app is added to a guild. Defaults to true */
|
|
2538
2585
|
readonly default_permission?: boolean
|
|
2586
|
+
/** In preview. Installation context(s) where the command is available */
|
|
2587
|
+
readonly integration_types?: Array<ApplicationIntegrationType>
|
|
2588
|
+
/** In preview. Interaction context(s) where the command can be used */
|
|
2589
|
+
readonly contexts?: Array<InteractionContextType>
|
|
2539
2590
|
/** Indicates whether the command is age-restricted */
|
|
2540
2591
|
readonly nsfw?: boolean
|
|
2541
2592
|
}
|
|
@@ -2739,7 +2790,7 @@ export interface Endpoints<O> {
|
|
|
2739
2790
|
guildId: string,
|
|
2740
2791
|
options?: O,
|
|
2741
2792
|
) => RestResponse<any>
|
|
2742
|
-
/** Begin a prune operation. Requires the KICK_MEMBERS
|
|
2793
|
+
/** Begin a prune operation. Requires the MANAGE_GUILD and KICK_MEMBERS permissions. Returns an object with one pruned key indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing pruned to null. Fires multiple Guild Member Remove Gateway events. */
|
|
2743
2794
|
beginGuildPrune: (
|
|
2744
2795
|
guildId: string,
|
|
2745
2796
|
params?: Partial<BeginGuildPruneParams>,
|
|
@@ -2751,6 +2802,12 @@ export interface Endpoints<O> {
|
|
|
2751
2802
|
params?: Partial<BulkDeleteMessageParams>,
|
|
2752
2803
|
options?: O,
|
|
2753
2804
|
) => RestResponse<any>
|
|
2805
|
+
/** Ban up to 200 users from a guild, and optionally delete previous messages sent by the banned users. Requires both the BAN_MEMBERS and MANAGE_GUILD permissions. Returns a 200 response on success, including the fields banned_users with the IDs of the banned users and failed_users with IDs that could not be banned or were already banned. */
|
|
2806
|
+
bulkGuildBan: (
|
|
2807
|
+
guildId: string,
|
|
2808
|
+
params?: Partial<BulkGuildBanParams>,
|
|
2809
|
+
options?: O,
|
|
2810
|
+
) => RestResponse<BulkGuildBanResponse>
|
|
2754
2811
|
/** Takes a list of application commands, overwriting the existing global command list for this application. Returns 200 and a list of application command objects. Commands that do not already exist will count toward daily application command create limits. */
|
|
2755
2812
|
bulkOverwriteGlobalApplicationCommands: (
|
|
2756
2813
|
applicationId: string,
|
|
@@ -3294,7 +3351,7 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
|
|
|
3294
3351
|
/** Returns the guild preview object for the given id.
|
|
3295
3352
|
If the user is not in the guild, then the guild must be discoverable. */
|
|
3296
3353
|
getGuildPreview: (guildId: string, options?: O) => RestResponse<GuildPreview>
|
|
3297
|
-
/** Returns an object with one pruned key indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS
|
|
3354
|
+
/** Returns an object with one pruned key indicating the number of members that would be removed in a prune operation. Requires the MANAGE_GUILD and KICK_MEMBERS permissions. */
|
|
3298
3355
|
getGuildPruneCount: (
|
|
3299
3356
|
guildId: string,
|
|
3300
3357
|
params?: Partial<GetGuildPruneCountParams>,
|
|
@@ -4637,14 +4694,18 @@ export interface Interaction {
|
|
|
4637
4694
|
readonly version: number
|
|
4638
4695
|
/** For components, the message they were attached to */
|
|
4639
4696
|
readonly message?: Message
|
|
4640
|
-
/** Bitwise set of permissions the app
|
|
4641
|
-
readonly app_permissions
|
|
4697
|
+
/** Bitwise set of permissions the app has in the source location of the interaction */
|
|
4698
|
+
readonly app_permissions: string
|
|
4642
4699
|
/** Selected language of the invoking user */
|
|
4643
4700
|
readonly locale?: string
|
|
4644
4701
|
/** Guild's preferred locale, if invoked in a guild */
|
|
4645
4702
|
readonly guild_locale?: string
|
|
4646
4703
|
/** For monetized apps, any entitlements for the invoking user, representing access to premium SKUs */
|
|
4647
4704
|
readonly entitlements: Array<Entitlement>
|
|
4705
|
+
/** Mapping of installation contexts that the interaction was authorized for to related user or guild IDs. See Authorizing Integration Owners Object for details */
|
|
4706
|
+
readonly authorizing_integration_owners: ApplicationIntegrationType
|
|
4707
|
+
/** Context where the interaction was triggered from */
|
|
4708
|
+
readonly context?: InteractionContextType
|
|
4648
4709
|
}
|
|
4649
4710
|
export interface InteractionCallbackAutocomplete {
|
|
4650
4711
|
/** autocomplete choices (max of 25 choices) */
|
|
@@ -4696,6 +4757,14 @@ export enum InteractionCallbackType {
|
|
|
4696
4757
|
/** respond to an interaction with an upgrade button, only available for apps with monetization enabled */
|
|
4697
4758
|
PREMIUM_REQUIRED = 10,
|
|
4698
4759
|
}
|
|
4760
|
+
export enum InteractionContextType {
|
|
4761
|
+
/** Interaction can be used within servers */
|
|
4762
|
+
GUILD = 0,
|
|
4763
|
+
/** Interaction can be used within DMs with the app's bot user */
|
|
4764
|
+
BOT_DM = 1,
|
|
4765
|
+
/** Interaction can be used within Group DMs and DMs other than the app's bot user */
|
|
4766
|
+
PRIVATE_CHANNEL = 2,
|
|
4767
|
+
}
|
|
4699
4768
|
export type InteractionCreateEvent = Interaction
|
|
4700
4769
|
export type InteractionDatum =
|
|
4701
4770
|
| ApplicationCommandDatum
|
|
@@ -4990,7 +5059,9 @@ export interface Message {
|
|
|
4990
5059
|
readonly flags?: number
|
|
4991
5060
|
/** the message associated with the message_reference */
|
|
4992
5061
|
readonly referenced_message?: Message | null
|
|
4993
|
-
/**
|
|
5062
|
+
/** In preview. Sent if the message is sent as a result of an interaction */
|
|
5063
|
+
readonly interaction_metadata?: MessageInteractionMetadatum
|
|
5064
|
+
/** Deprecated in favor of interaction_metadata; sent if the message is a response to an interaction */
|
|
4994
5065
|
readonly interaction?: MessageInteraction
|
|
4995
5066
|
/** the thread that was started from this message, includes thread member object */
|
|
4996
5067
|
readonly thread?: Channel
|
|
@@ -5090,6 +5161,22 @@ export interface MessageInteraction {
|
|
|
5090
5161
|
/** Member who invoked the interaction in the guild */
|
|
5091
5162
|
readonly member?: GuildMember
|
|
5092
5163
|
}
|
|
5164
|
+
export interface MessageInteractionMetadatum {
|
|
5165
|
+
/** ID of the interaction */
|
|
5166
|
+
readonly id: Snowflake
|
|
5167
|
+
/** Type of interaction */
|
|
5168
|
+
readonly type: InteractionType
|
|
5169
|
+
/** ID of the user who triggered the interaction */
|
|
5170
|
+
readonly user_id: Snowflake
|
|
5171
|
+
/** IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object */
|
|
5172
|
+
readonly authorizing_integration_owners: ApplicationIntegrationType
|
|
5173
|
+
/** ID of the original response message, present only on follow-up messages */
|
|
5174
|
+
readonly original_response_message_id?: Snowflake
|
|
5175
|
+
/** ID of the message that contained interactive component, present only on messages created from component interactions */
|
|
5176
|
+
readonly interacted_message_id?: Snowflake
|
|
5177
|
+
/** Metadata for the interaction that was used to open the modal, present only on modal submit interactions */
|
|
5178
|
+
readonly triggering_interaction_metadata?: MessageInteractionMetadatum
|
|
5179
|
+
}
|
|
5093
5180
|
export interface MessageReactionAddEvent {
|
|
5094
5181
|
/** ID of the user */
|
|
5095
5182
|
readonly user_id: Snowflake
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.91.
|
|
1
|
+
export const LIB_VERSION = "0.91.3";
|
package/types.d.ts
CHANGED
|
@@ -199,6 +199,8 @@ export interface Application {
|
|
|
199
199
|
readonly tags?: Array<string>;
|
|
200
200
|
/** Settings for the app's default in-app authorization link, if enabled */
|
|
201
201
|
readonly install_params?: InstallParam;
|
|
202
|
+
/** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
|
|
203
|
+
readonly integration_types_config?: ApplicationIntegrationType;
|
|
202
204
|
/** Default custom authorization URL for the app, if enabled */
|
|
203
205
|
readonly custom_install_url?: string;
|
|
204
206
|
}
|
|
@@ -223,12 +225,16 @@ export interface ApplicationCommand {
|
|
|
223
225
|
readonly options?: Array<ApplicationCommandOption>;
|
|
224
226
|
/** Set of permissions represented as a bit set */
|
|
225
227
|
readonly default_member_permissions?: string | null;
|
|
226
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
228
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
227
229
|
readonly dm_permission?: boolean;
|
|
228
230
|
/** Not recommended for use as field will soon be deprecated. Indicates whether the command is enabled by default when the app is added to a guild, defaults to true */
|
|
229
231
|
readonly default_permission?: boolean | null;
|
|
230
232
|
/** Indicates whether the command is age-restricted, defaults to false */
|
|
231
233
|
readonly nsfw?: boolean;
|
|
234
|
+
/** In preview. Installation context(s) where the command is available, only for globally-scoped commands. Defaults to GUILD_INSTALL (0) */
|
|
235
|
+
readonly integration_types?: Array<ApplicationIntegrationType>;
|
|
236
|
+
/** In preview. Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands. */
|
|
237
|
+
readonly contexts?: Array<InteractionContextType> | null;
|
|
232
238
|
/** Autoincrementing version identifier updated during substantial record changes */
|
|
233
239
|
readonly version: Snowflake;
|
|
234
240
|
}
|
|
@@ -355,6 +361,12 @@ export declare const ApplicationFlag: {
|
|
|
355
361
|
/** Indicates if an app has registered global application commands */
|
|
356
362
|
readonly APPLICATION_COMMAND_BADGE: number;
|
|
357
363
|
};
|
|
364
|
+
export declare enum ApplicationIntegrationType {
|
|
365
|
+
/** App is installable to servers */
|
|
366
|
+
GUILD_INSTALL = 0,
|
|
367
|
+
/** App is installable to users */
|
|
368
|
+
USER_INSTALL = 1
|
|
369
|
+
}
|
|
358
370
|
export interface ApplicationRoleConnection {
|
|
359
371
|
/** the vanity name of the platform a bot has connected (max 50 characters) */
|
|
360
372
|
readonly platform_name?: string | null;
|
|
@@ -682,10 +694,28 @@ export interface BeginGuildPruneParams {
|
|
|
682
694
|
/** reason for the prune (deprecated) */
|
|
683
695
|
readonly reason?: string;
|
|
684
696
|
}
|
|
697
|
+
export interface BulkBanResponse {
|
|
698
|
+
/** list of user ids, that were successfully banned */
|
|
699
|
+
readonly banned_users: Array<Snowflake>;
|
|
700
|
+
/** list of user ids, that were not banned */
|
|
701
|
+
readonly failed_users: Array<Snowflake>;
|
|
702
|
+
}
|
|
685
703
|
export interface BulkDeleteMessageParams {
|
|
686
704
|
/** an array of message ids to delete (2-100) */
|
|
687
705
|
readonly messages: Array<Snowflake>;
|
|
688
706
|
}
|
|
707
|
+
export interface BulkGuildBanParams {
|
|
708
|
+
/** list of user ids to ban (max 200) */
|
|
709
|
+
readonly user_ids: Array<Snowflake>;
|
|
710
|
+
/** number of seconds to delete messages for, between 0 and 604800 (7 days) */
|
|
711
|
+
readonly delete_message_seconds?: number;
|
|
712
|
+
}
|
|
713
|
+
export interface BulkGuildBanResponse {
|
|
714
|
+
/** list of user ids, that were successfully banned */
|
|
715
|
+
readonly banned_users: Array<Snowflake>;
|
|
716
|
+
/** list of user ids, that were not banned */
|
|
717
|
+
readonly failed_users: Array<Snowflake>;
|
|
718
|
+
}
|
|
689
719
|
export interface BulkOverwriteGuildApplicationCommandParams {
|
|
690
720
|
/** ID of the command, if known */
|
|
691
721
|
readonly id?: Snowflake;
|
|
@@ -701,10 +731,14 @@ export interface BulkOverwriteGuildApplicationCommandParams {
|
|
|
701
731
|
readonly options?: Array<ApplicationCommandOption>;
|
|
702
732
|
/** Set of permissions represented as a bit set */
|
|
703
733
|
readonly default_member_permissions?: string | null;
|
|
704
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
734
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
705
735
|
readonly dm_permission?: boolean | null;
|
|
706
736
|
/** Replaced by default_member_permissions and will be deprecated in the future. Indicates whether the command is enabled by default when the app is added to a guild. Defaults to true */
|
|
707
737
|
readonly default_permission?: boolean;
|
|
738
|
+
/** In preview. Installation context(s) where the command is available, defaults to GUILD_INSTALL ([0]) */
|
|
739
|
+
readonly integration_types: Array<ApplicationIntegrationType>;
|
|
740
|
+
/** In preview. Interaction context(s) where the command can be used, defaults to all contexts [0,1,2] */
|
|
741
|
+
readonly contexts: Array<InteractionContextType>;
|
|
708
742
|
/** Type of command, defaults 1 if not set */
|
|
709
743
|
readonly type?: ApplicationCommandType;
|
|
710
744
|
/** Indicates whether the command is age-restricted */
|
|
@@ -962,10 +996,14 @@ export interface CreateGlobalApplicationCommandParams {
|
|
|
962
996
|
readonly options?: Array<ApplicationCommandOption>;
|
|
963
997
|
/** Set of permissions represented as a bit set */
|
|
964
998
|
readonly default_member_permissions?: string | null;
|
|
965
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
999
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
966
1000
|
readonly dm_permission?: boolean | null;
|
|
967
1001
|
/** Replaced by default_member_permissions and will be deprecated in the future. Indicates whether the command is enabled by default when the app is added to a guild. Defaults to true */
|
|
968
1002
|
readonly default_permission?: boolean;
|
|
1003
|
+
/** Installation context(s) where the command is available */
|
|
1004
|
+
readonly integration_types?: Array<ApplicationIntegrationType>;
|
|
1005
|
+
/** Interaction context(s) where the command can be used */
|
|
1006
|
+
readonly contexts?: Array<InteractionContextType>;
|
|
969
1007
|
/** Type of command, defaults 1 if not set */
|
|
970
1008
|
readonly type?: ApplicationCommandType;
|
|
971
1009
|
/** Indicates whether the command is age-restricted */
|
|
@@ -1154,7 +1192,7 @@ export interface CreateMessageParams {
|
|
|
1154
1192
|
readonly files?: string;
|
|
1155
1193
|
/** JSON-encoded body of non-file params, only for multipart/form-data requests. See Uploading Files */
|
|
1156
1194
|
readonly payload_json?: string;
|
|
1157
|
-
/** Attachment objects with filename and description. See
|
|
1195
|
+
/** Attachment objects with filename and description. See Uploading Files */
|
|
1158
1196
|
readonly attachments?: Array<Attachment>;
|
|
1159
1197
|
/** Message flags combined as a bitfield (only SUPPRESS_EMBEDS and SUPPRESS_NOTIFICATIONS can be set) */
|
|
1160
1198
|
readonly flags?: number;
|
|
@@ -1217,6 +1255,8 @@ export interface EditCurrentApplicationParams {
|
|
|
1217
1255
|
readonly role_connections_verification_url: string;
|
|
1218
1256
|
/** Settings for the app's default in-app authorization link, if enabled */
|
|
1219
1257
|
readonly install_params: InstallParam;
|
|
1258
|
+
/** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
|
|
1259
|
+
readonly integration_types_config: ApplicationIntegrationType;
|
|
1220
1260
|
/** App's public flags */
|
|
1221
1261
|
readonly flags: number;
|
|
1222
1262
|
/** Icon for the app */
|
|
@@ -1241,10 +1281,14 @@ export interface EditGlobalApplicationCommandParams {
|
|
|
1241
1281
|
readonly options?: Array<ApplicationCommandOption>;
|
|
1242
1282
|
/** Set of permissions represented as a bit set */
|
|
1243
1283
|
readonly default_member_permissions?: string | null;
|
|
1244
|
-
/** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
1284
|
+
/** Deprecated (use contexts instead); Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
|
|
1245
1285
|
readonly dm_permission?: boolean | null;
|
|
1246
1286
|
/** Replaced by default_member_permissions and will be deprecated in the future. Indicates whether the command is enabled by default when the app is added to a guild. Defaults to true */
|
|
1247
1287
|
readonly default_permission?: boolean;
|
|
1288
|
+
/** In preview. Installation context(s) where the command is available */
|
|
1289
|
+
readonly integration_types?: Array<ApplicationIntegrationType>;
|
|
1290
|
+
/** In preview. Interaction context(s) where the command can be used */
|
|
1291
|
+
readonly contexts?: Array<InteractionContextType>;
|
|
1248
1292
|
/** Indicates whether the command is age-restricted */
|
|
1249
1293
|
readonly nsfw?: boolean;
|
|
1250
1294
|
}
|
|
@@ -1430,10 +1474,12 @@ export interface Endpoints<O> {
|
|
|
1430
1474
|
/** Adds another member to a thread. Requires the ability to send messages in the thread. Also requires the thread is not archived. Returns a 204 empty response if the member is successfully added or was already a member of the thread. Fires a Thread Members Update Gateway event. */
|
|
1431
1475
|
addThreadMember: (channelId: string, userId: string, options?: O) => RestResponse<any>;
|
|
1432
1476
|
batchEditApplicationCommandPermissions: (applicationId: string, guildId: string, options?: O) => RestResponse<any>;
|
|
1433
|
-
/** Begin a prune operation. Requires the KICK_MEMBERS
|
|
1477
|
+
/** Begin a prune operation. Requires the MANAGE_GUILD and KICK_MEMBERS permissions. Returns an object with one pruned key indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing pruned to null. Fires multiple Guild Member Remove Gateway events. */
|
|
1434
1478
|
beginGuildPrune: (guildId: string, params?: Partial<BeginGuildPruneParams>, options?: O) => RestResponse<any>;
|
|
1435
1479
|
/** Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success. Fires a Message Delete Bulk Gateway event. */
|
|
1436
1480
|
bulkDeleteMessages: (channelId: string, params?: Partial<BulkDeleteMessageParams>, options?: O) => RestResponse<any>;
|
|
1481
|
+
/** Ban up to 200 users from a guild, and optionally delete previous messages sent by the banned users. Requires both the BAN_MEMBERS and MANAGE_GUILD permissions. Returns a 200 response on success, including the fields banned_users with the IDs of the banned users and failed_users with IDs that could not be banned or were already banned. */
|
|
1482
|
+
bulkGuildBan: (guildId: string, params?: Partial<BulkGuildBanParams>, options?: O) => RestResponse<BulkGuildBanResponse>;
|
|
1437
1483
|
/** Takes a list of application commands, overwriting the existing global command list for this application. Returns 200 and a list of application command objects. Commands that do not already exist will count toward daily application command create limits. */
|
|
1438
1484
|
bulkOverwriteGlobalApplicationCommands: (applicationId: string, options?: O) => RestResponse<Array<ApplicationCommand>>;
|
|
1439
1485
|
/** Takes a list of application commands, overwriting the existing command list for this application for the targeted guild. Returns 200 and a list of application command objects. */
|
|
@@ -1625,7 +1671,7 @@ export interface Endpoints<O> {
|
|
|
1625
1671
|
/** Returns the guild preview object for the given id.
|
|
1626
1672
|
If the user is not in the guild, then the guild must be discoverable. */
|
|
1627
1673
|
getGuildPreview: (guildId: string, options?: O) => RestResponse<GuildPreview>;
|
|
1628
|
-
/** Returns an object with one pruned key indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS
|
|
1674
|
+
/** Returns an object with one pruned key indicating the number of members that would be removed in a prune operation. Requires the MANAGE_GUILD and KICK_MEMBERS permissions. */
|
|
1629
1675
|
getGuildPruneCount: (guildId: string, params?: Partial<GetGuildPruneCountParams>, options?: O) => RestResponse<any>;
|
|
1630
1676
|
/** Returns a list of role objects for the guild. */
|
|
1631
1677
|
getGuildRoles: (guildId: string, options?: O) => RestResponse<Array<Role>>;
|
|
@@ -2700,14 +2746,18 @@ export interface Interaction {
|
|
|
2700
2746
|
readonly version: number;
|
|
2701
2747
|
/** For components, the message they were attached to */
|
|
2702
2748
|
readonly message?: Message;
|
|
2703
|
-
/** Bitwise set of permissions the app
|
|
2704
|
-
readonly app_permissions
|
|
2749
|
+
/** Bitwise set of permissions the app has in the source location of the interaction */
|
|
2750
|
+
readonly app_permissions: string;
|
|
2705
2751
|
/** Selected language of the invoking user */
|
|
2706
2752
|
readonly locale?: string;
|
|
2707
2753
|
/** Guild's preferred locale, if invoked in a guild */
|
|
2708
2754
|
readonly guild_locale?: string;
|
|
2709
2755
|
/** For monetized apps, any entitlements for the invoking user, representing access to premium SKUs */
|
|
2710
2756
|
readonly entitlements: Array<Entitlement>;
|
|
2757
|
+
/** Mapping of installation contexts that the interaction was authorized for to related user or guild IDs. See Authorizing Integration Owners Object for details */
|
|
2758
|
+
readonly authorizing_integration_owners: ApplicationIntegrationType;
|
|
2759
|
+
/** Context where the interaction was triggered from */
|
|
2760
|
+
readonly context?: InteractionContextType;
|
|
2711
2761
|
}
|
|
2712
2762
|
export interface InteractionCallbackAutocomplete {
|
|
2713
2763
|
/** autocomplete choices (max of 25 choices) */
|
|
@@ -2756,6 +2806,14 @@ export declare enum InteractionCallbackType {
|
|
|
2756
2806
|
/** respond to an interaction with an upgrade button, only available for apps with monetization enabled */
|
|
2757
2807
|
PREMIUM_REQUIRED = 10
|
|
2758
2808
|
}
|
|
2809
|
+
export declare enum InteractionContextType {
|
|
2810
|
+
/** Interaction can be used within servers */
|
|
2811
|
+
GUILD = 0,
|
|
2812
|
+
/** Interaction can be used within DMs with the app's bot user */
|
|
2813
|
+
BOT_DM = 1,
|
|
2814
|
+
/** Interaction can be used within Group DMs and DMs other than the app's bot user */
|
|
2815
|
+
PRIVATE_CHANNEL = 2
|
|
2816
|
+
}
|
|
2759
2817
|
export type InteractionCreateEvent = Interaction;
|
|
2760
2818
|
export type InteractionDatum = ApplicationCommandDatum | MessageComponentDatum | ModalSubmitDatum;
|
|
2761
2819
|
export interface InteractionResponse {
|
|
@@ -3047,7 +3105,9 @@ export interface Message {
|
|
|
3047
3105
|
readonly flags?: number;
|
|
3048
3106
|
/** the message associated with the message_reference */
|
|
3049
3107
|
readonly referenced_message?: Message | null;
|
|
3050
|
-
/**
|
|
3108
|
+
/** In preview. Sent if the message is sent as a result of an interaction */
|
|
3109
|
+
readonly interaction_metadata?: MessageInteractionMetadatum;
|
|
3110
|
+
/** Deprecated in favor of interaction_metadata; sent if the message is a response to an interaction */
|
|
3051
3111
|
readonly interaction?: MessageInteraction;
|
|
3052
3112
|
/** the thread that was started from this message, includes thread member object */
|
|
3053
3113
|
readonly thread?: Channel;
|
|
@@ -3147,6 +3207,22 @@ export interface MessageInteraction {
|
|
|
3147
3207
|
/** Member who invoked the interaction in the guild */
|
|
3148
3208
|
readonly member?: GuildMember;
|
|
3149
3209
|
}
|
|
3210
|
+
export interface MessageInteractionMetadatum {
|
|
3211
|
+
/** ID of the interaction */
|
|
3212
|
+
readonly id: Snowflake;
|
|
3213
|
+
/** Type of interaction */
|
|
3214
|
+
readonly type: InteractionType;
|
|
3215
|
+
/** ID of the user who triggered the interaction */
|
|
3216
|
+
readonly user_id: Snowflake;
|
|
3217
|
+
/** IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object */
|
|
3218
|
+
readonly authorizing_integration_owners: ApplicationIntegrationType;
|
|
3219
|
+
/** ID of the original response message, present only on follow-up messages */
|
|
3220
|
+
readonly original_response_message_id?: Snowflake;
|
|
3221
|
+
/** ID of the message that contained interactive component, present only on messages created from component interactions */
|
|
3222
|
+
readonly interacted_message_id?: Snowflake;
|
|
3223
|
+
/** Metadata for the interaction that was used to open the modal, present only on modal submit interactions */
|
|
3224
|
+
readonly triggering_interaction_metadata?: MessageInteractionMetadatum;
|
|
3225
|
+
}
|
|
3150
3226
|
export interface MessageReactionAddEvent {
|
|
3151
3227
|
/** ID of the user */
|
|
3152
3228
|
readonly user_id: Snowflake;
|