diff --git a/packages/core/src/api/applicationCommands.ts b/packages/core/src/api/applicationCommands.ts index 61e26ba5b391..a1083ceb020d 100644 --- a/packages/core/src/api/applicationCommands.ts +++ b/packages/core/src/api/applicationCommands.ts @@ -5,18 +5,26 @@ import { Routes, type RESTGetAPIApplicationCommandPermissionsResult, type RESTGetAPIApplicationCommandResult, + type RESTGetAPIApplicationCommandsQuery, type RESTGetAPIApplicationCommandsResult, + type RESTGetAPIApplicationGuildCommandResult, + type RESTGetAPIApplicationGuildCommandsQuery, + type RESTGetAPIApplicationGuildCommandsResult, type RESTGetAPIGuildApplicationCommandsPermissionsResult, type RESTPatchAPIApplicationCommandJSONBody, type RESTPatchAPIApplicationCommandResult, + type RESTPatchAPIApplicationGuildCommandJSONBody, + type RESTPatchAPIApplicationGuildCommandResult, type RESTPostAPIApplicationCommandsJSONBody, type RESTPostAPIApplicationCommandsResult, + type RESTPostAPIApplicationGuildCommandsJSONBody, + type RESTPostAPIApplicationGuildCommandsResult, type RESTPutAPIApplicationCommandPermissionsJSONBody, type RESTPutAPIApplicationCommandPermissionsResult, type RESTPutAPIApplicationCommandsJSONBody, - type RESTGetAPIApplicationCommandsQuery, type RESTPutAPIApplicationCommandsResult, - type RESTGetAPIApplicationGuildCommandsQuery, + type RESTPutAPIApplicationGuildCommandsJSONBody, + type RESTPutAPIApplicationGuildCommandsResult, type Snowflake, } from 'discord-api-types/v10'; @@ -153,7 +161,7 @@ export class ApplicationCommandsAPI { return this.rest.get(Routes.applicationGuildCommands(applicationId, guildId), { query: makeURLSearchParams(query), signal, - }) as Promise; + }) as Promise; } /** @@ -168,13 +176,13 @@ export class ApplicationCommandsAPI { public async createGuildCommand( applicationId: Snowflake, guildId: Snowflake, - body: RESTPostAPIApplicationCommandsJSONBody, + body: RESTPostAPIApplicationGuildCommandsJSONBody, { signal }: Pick = {}, ) { return this.rest.post(Routes.applicationGuildCommands(applicationId, guildId), { body, signal, - }) as Promise; + }) as Promise; } /** @@ -194,7 +202,7 @@ export class ApplicationCommandsAPI { ) { return this.rest.get(Routes.applicationGuildCommand(applicationId, guildId, commandId), { signal, - }) as Promise; + }) as Promise; } /** @@ -211,13 +219,13 @@ export class ApplicationCommandsAPI { applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, - body: RESTPatchAPIApplicationCommandJSONBody, + body: RESTPatchAPIApplicationGuildCommandJSONBody, { signal }: Pick = {}, ) { return this.rest.patch(Routes.applicationGuildCommand(applicationId, guildId, commandId), { body, signal, - }) as Promise; + }) as Promise; } /** @@ -250,13 +258,13 @@ export class ApplicationCommandsAPI { public async bulkOverwriteGuildCommands( applicationId: Snowflake, guildId: Snowflake, - body: RESTPutAPIApplicationCommandsJSONBody, + body: RESTPutAPIApplicationGuildCommandsJSONBody, { signal }: Pick = {}, ) { return this.rest.put(Routes.applicationGuildCommands(applicationId, guildId), { body, signal, - }) as Promise; + }) as Promise; } /** diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index 81aae5e1baa6..2f74b3caf43b 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -47,8 +47,10 @@ import type { RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetImageResult, RESTGetAPIGuildWidgetJSONResult, + RESTGetAPIGuildWidgetSettingsResult, RESTGetAPITemplateResult, RESTPatchAPIAutoModerationRuleJSONBody, + RESTPatchAPIAutoModerationRuleResult, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, @@ -78,6 +80,7 @@ import type { RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPostAPIGuildPruneJSONBody, + RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPostAPIGuildScheduledEventJSONBody, @@ -85,8 +88,8 @@ import type { RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsMFAResult, RESTPostAPIGuildsResult, + RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, - RESTPostAPITemplateCreateGuildJSONBody, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildTemplateSyncResult, Snowflake, @@ -446,7 +449,7 @@ export class GuildsAPI { body, reason, signal, - }) as Promise; + }) as Promise; } /** @@ -506,7 +509,9 @@ export class GuildsAPI { * @param options - The options for fetching the widget settings */ public async getWidgetSettings(guildId: Snowflake, { signal }: Pick = {}) { - return this.rest.get(Routes.guildWidgetSettings(guildId), { signal }) as Promise; + return this.rest.get(Routes.guildWidgetSettings(guildId), { + signal, + }) as Promise; } /** @@ -1051,7 +1056,7 @@ export class GuildsAPI { reason, body, signal, - }) as Promise; + }) as Promise; } /** @@ -1196,7 +1201,7 @@ export class GuildsAPI { */ public async createTemplate( templateCode: string, - body: RESTPostAPITemplateCreateGuildJSONBody, + body: RESTPostAPIGuildTemplatesJSONBody, { signal }: Pick = {}, ) { return this.rest.post(Routes.template(templateCode), { body, signal }) as Promise; diff --git a/packages/core/src/api/interactions.ts b/packages/core/src/api/interactions.ts index 0ede26300c2c..21a5066f9d7c 100644 --- a/packages/core/src/api/interactions.ts +++ b/packages/core/src/api/interactions.ts @@ -103,7 +103,7 @@ export class InteractionsAPI { body: APIInteractionResponseCallbackData & { files?: RawFile[] }, { signal }: Pick = {}, ) { - await this.webhooks.execute(applicationId, interactionToken, body, { signal }); + return this.webhooks.execute(applicationId, interactionToken, { ...body, wait: true }, { signal }); } /** diff --git a/packages/core/src/api/webhook.ts b/packages/core/src/api/webhook.ts index 2b8ed3e4e49e..6f986198c8ef 100644 --- a/packages/core/src/api/webhook.ts +++ b/packages/core/src/api/webhook.ts @@ -4,17 +4,17 @@ import { makeURLSearchParams, type RequestData, type RawFile, type REST } from ' import { Routes, type RESTGetAPIWebhookWithTokenMessageQuery, - type RESTGetAPIChannelMessageResult, + type RESTGetAPIWebhookWithTokenMessageResult, type RESTGetAPIWebhookResult, type RESTPatchAPIWebhookJSONBody, type RESTPatchAPIWebhookResult, type RESTPatchAPIWebhookWithTokenMessageJSONBody, type RESTPatchAPIWebhookWithTokenMessageResult, type RESTPostAPIChannelWebhookJSONBody, + type RESTPostAPIChannelWebhookResult, type RESTPostAPIWebhookWithTokenGitHubQuery, type RESTPostAPIWebhookWithTokenJSONBody, type RESTPostAPIWebhookWithTokenQuery, - type RESTPostAPIWebhookWithTokenResult, type RESTPostAPIWebhookWithTokenSlackQuery, type RESTPostAPIWebhookWithTokenWaitResult, type Snowflake, @@ -53,7 +53,7 @@ export class WebhooksAPI { reason, body, signal, - }) as Promise; + }) as Promise; } /** @@ -225,7 +225,7 @@ export class WebhooksAPI { query: makeURLSearchParams(query), auth: false, signal, - }) as Promise; + }) as Promise; } /**