diff --git a/packages/core/src/api/application.ts b/packages/core/src/api/application.ts new file mode 100644 index 0000000000000..892d76de9c522 --- /dev/null +++ b/packages/core/src/api/application.ts @@ -0,0 +1,28 @@ +/* eslint-disable jsdoc/check-param-names */ + +import type { RequestData, REST } from '@discordjs/rest'; +import { + // @ts-expect-error discord-api-types + type RESTPatchCurrentApplicationJSONBody, + // @ts-expect-error discord-api-types + type RESTPatchCurrentApplicationResult, + Routes, +} from 'discord-api-types/v10'; + +export class ApplicationsAPI { + public constructor(private readonly rest: REST) {} + + /** + * Edits properties of the application associated with the requesting bot user. + * + * @see {@link https://discord.com/developers/docs/resources/application#edit-current-application} + * @param body - The new application data + * @param options - The options for editing the application + */ + public async edit(body: RESTPatchCurrentApplicationJSONBody, { signal }: Pick = {}) { + return this.rest.patch(Routes.currentApplication(), { + body, + signal, + }) as Promise; + } +}