Repository: discordjs/discord.js
File: packages/core/src/api/guild.ts (TypeScript)

Code before:
	 */
	public async createTemplate(
		templateCode: string,
		body: RESTPostAPIGuildTemplatesJSONBody,
		{ signal }: Pick<RequestData, 'signal'> = {},
	) {
		return this.rest.post(Routes.template(templateCode), { body, signal }) as Promise<RESTPostAPIGuildTemplatesResult>;
	}

	/**
	 * Fetches webhooks for a guild
	 *
	 * @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
	 * @param id - The id of the guild
	 */
	public async getWebhooks(id: Snowflake) {
		return this.rest.get(Routes.guildWebhooks(id)) as Promise<RESTGetAPIGuildWebhooksResult>;
	}

	/**
	 * Sets the voice state for the current user
	 *
	 * @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
	 * @param guildId - The id of the guild
	 * @param body - The options for setting the voice state
	 * @deprecated Use {@link VoiceAPI.setVoiceState}
	 */
	public async setVoiceState(guildId: Snowflake, body: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = {}) {
		return this.rest.patch(Routes.guildVoiceState(guildId, '@me'), {
			body,
		}) as Promise<RESTPatchAPIGuildVoiceStateCurrentMemberResult>;
	}

	/**
	 * Fetches a guild onboarding
	 *
	 * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-onboarding}
	 * @param guildId - The id of the guild
	 * @param options - The options for fetching the guild onboarding
	 */
	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

Review comment (suggestion):
```suggestion
	 * @deprecated Use {@link VoiceAPI.editVoiceState}
```

Code after:
	public async createTemplate(
		templateCode: string,
		body: RESTPostAPIGuildTemplatesJSONBody,
		{ signal }: Pick<RequestData, 'signal'> = {},
	) {
		return this.rest.post(Routes.template(templateCode), { body, signal }) as Promise<RESTPostAPIGuildTemplatesResult>;
	}

	/**
	 * Fetches webhooks for a guild
	 *
	 * @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
	 * @param id - The id of the guild
	 */
	public async getWebhooks(id: Snowflake) {
		return this.rest.get(Routes.guildWebhooks(id)) as Promise<RESTGetAPIGuildWebhooksResult>;
	}

	/**
	 * Sets the voice state for the current user
	 *
	 * @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
	 * @param guildId - The id of the guild
	 * @param body - The data for setting the voice state
	 * @param options - The options for setting the voice state
	 * @deprecated Use {@link VoiceAPI.editVoiceState} instead
	 */
	public async setVoiceState(
		guildId: Snowflake,
		body: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = {},
		{ signal }: Pick<RequestData, 'signal'> = {},
	) {
		return new VoiceAPI(this.rest).editVoiceState(guildId, body, { signal });
	}

	/**
	 * Fetches a guild onboarding
	 *
	 * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-onboarding}
	 * @param guildId - The id of the guild
	 * @param options - The options for fetching the guild onboarding
	 */
	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