Skip to content

Commit

Permalink
fix(creator): dont use callback on pings
Browse files Browse the repository at this point in the history
closes #626
  • Loading branch information
Snazzah committed Dec 18, 2024
1 parent a6c1ac7 commit 24d1c96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 24d1c96

Please sign in to comment.