mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: onboarding mode and edit method (#9647)
* feat: onboarding mode and edit method * feat(guild): add `editOnboarding` * fix: use discord-api-types * types: make arrays readonly Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * fix: bring up to date * docs: id is a snowflake * fix: requested changes * refactor: make most options optional * refactor: provide GuildEmoji or Emoji instance * revert: changes to Util * fix: rebase leftovers * fix: allow passing option id * fix: requested changes --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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<RequestData, 'signal'> = {}) {
|
||||
return this.rest.get(Routes.guildOnboarding(guildId), { signal }) as Promise<RESTGetAPIGuildOnboardingResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits a guild onboarding
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-onboarding}
|
||||
* @param guildId - The id of the guild
|
||||
* @param body - The data for editing the guild onboarding
|
||||
* @param options - The options for editing the guild onboarding
|
||||
*/
|
||||
public async editOnboarding(
|
||||
guildId: Snowflake,
|
||||
body: RESTPutAPIGuildOnboardingJSONBody,
|
||||
{ reason, signal }: Pick<RequestData, 'reason' | 'signal'> = {},
|
||||
) {
|
||||
return this.rest.put(Routes.guildOnboarding(guildId), {
|
||||
reason,
|
||||
body,
|
||||
signal,
|
||||
}) as Promise<RESTPutAPIGuildOnboardingResult>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user