From 24d1c9689019d8bcd84ed10c0033e43c7d792220 Mon Sep 17 00:00:00 2001 From: Snazzah Date: Tue, 17 Dec 2024 18:11:59 -0600 Subject: [PATCH] fix(creator): dont use callback on pings closes #626 --- src/creator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/creator.ts b/src/creator.ts index 199b64e2..44bd24ad 100644 --- a/src/creator.ts +++ b/src/creator.ts @@ -564,12 +564,12 @@ export class BaseSlashCreator extends (EventEmitter as any as new () => TypedEve this.emit('rawInteraction', interaction); // User preferred POSTing callbacks - if (this.options.postCallbacks && respond) + if (this.options.postCallbacks && respond && interaction.type !== InteractionType.PING) await respond({ status: 202 }); - if (!respond || !webserverMode || this.options.postCallbacks) + if (!respond || !webserverMode || (this.options.postCallbacks && interaction.type !== InteractionType.PING)) respond = this._createGatewayRespond(interaction.id, interaction.token); switch (interaction.type) {