From 63dbe48055347413ec70f36bce4f645688776413 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:07:17 +0100 Subject: [PATCH] feat(guild): Support incident actions (#11131) * feat(guild): add incident actions * fix: add result --------- Co-Authored-By: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/core/package.json | 2 +- packages/core/src/api/guild.ts | 21 +++++++++++++++++++++ pnpm-lock.yaml | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index e7fb394b7..43de9a419 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -70,7 +70,7 @@ "@discordjs/ws": "workspace:^", "@sapphire/snowflake": "^3.5.3", "@vladfrangu/async_event_emitter": "^2.4.6", - "discord-api-types": "^0.38.24" + "discord-api-types": "^0.38.29" }, "devDependencies": { "@discordjs/api-extractor": "workspace:^", diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index 54227619d..de105f878 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -95,6 +95,8 @@ import { type RESTPostAPIGuildsMFAResult, type RESTPostAPIGuildsResult, type RESTPutAPIGuildBanJSONBody, + type RESTPutAPIGuildIncidentActionsJSONBody, + type RESTPutAPIGuildIncidentActionsResult, type RESTPutAPIGuildMemberJSONBody, type RESTPutAPIGuildMemberResult, type RESTPutAPIGuildOnboardingJSONBody, @@ -1359,4 +1361,23 @@ export class GuildsAPI { signal, }) as Promise; } + + /** + * Modifies incident actions for a guild. + * + * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions} + * @param guildId - The id of the guild + * @param body - The data for modifying guild incident actions + * @param options - The options for modifying guild incident actions + */ + public async editIncidentActions( + guildId: Snowflake, + body: RESTPutAPIGuildIncidentActionsJSONBody, + { signal }: Pick = {}, + ) { + return this.rest.put(Routes.guildIncidentActions(guildId), { + body, + signal, + }) as Promise; + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a10f0d5b6..fea33ab9e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -816,8 +816,8 @@ importers: specifier: ^2.4.6 version: 2.4.6 discord-api-types: - specifier: ^0.38.24 - version: 0.38.24 + specifier: ^0.38.29 + version: 0.38.29 devDependencies: '@discordjs/api-extractor': specifier: workspace:^