diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index d2a31643a7f5..2d4712220216 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -92,6 +92,8 @@ import { type RESTPostAPIGuildsMFAResult, type RESTPostAPIGuildsResult, type RESTPutAPIGuildBanJSONBody, + type RESTPutAPIGuildOnboardingJSONBody, + type RESTPutAPIGuildOnboardingResult, type RESTPutAPIGuildTemplateSyncResult, type Snowflake, } from 'discord-api-types/v10'; @@ -1241,4 +1243,24 @@ export class GuildsAPI { public async getOnboarding(guildId: Snowflake, { signal }: Pick = {}) { return this.rest.get(Routes.guildOnboarding(guildId), { signal }) as Promise; } + + /** + * Edits the widget settings for a guild + * + * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-onboarding} + * @param guildId - The id of the guild to edit the onboarding settings from + * @param body - The new guild onboarding settings data + * @param options - The options for editing the guild onboarding + */ + public async editOnboarding( + guildId: Snowflake, + body: RESTPutAPIGuildOnboardingJSONBody, + { reason, signal }: Pick = {}, + ) { + return this.rest.put(Routes.guildOnboarding(guildId), { + reason, + body, + signal, + }) as Promise; + } }