diff --git a/packages/core/src/api/webhook.ts b/packages/core/src/api/webhook.ts index cfa25122b..d54253c25 100644 --- a/packages/core/src/api/webhook.ts +++ b/packages/core/src/api/webhook.ts @@ -27,11 +27,16 @@ export class WebhooksAPI { * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook} * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token} * @param id - The id of the webhook - * @param token - The token of the webhook * @param options - The options for fetching the webhook */ - public async get(id: Snowflake, token?: string, { signal }: Pick = {}) { - return this.rest.get(Routes.webhook(id, token), { signal }) as Promise; + public async get( + id: Snowflake, + { token, signal }: Pick & { token?: string | undefined } = {}, + ) { + return this.rest.get(Routes.webhook(id, token), { + signal, + auth: !token, + }) as Promise; } /** @@ -52,6 +57,7 @@ export class WebhooksAPI { reason, body, signal, + auth: !token, }) as Promise; } @@ -67,7 +73,11 @@ export class WebhooksAPI { id: Snowflake, { token, reason, signal }: Pick & { token?: string | undefined } = {}, ) { - await this.rest.delete(Routes.webhook(id, token), { reason, signal }); + await this.rest.delete(Routes.webhook(id, token), { + reason, + signal, + auth: !token, + }); } /**