Skip to content

Commit

Permalink
fix(InteractionCreateEvent): incorrect type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ijsKoud committed Jun 26, 2023
1 parent e6e0076 commit f6bef2b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Events/InteractionCreateEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,9 @@ export default class extends EventListener {
const interactionListener = this.client.interactionHandler.interactions.find((intListener) =>
CheckFunction(intListener.name, intListener.strategy, intListener.check)
);
if (
!interactionListener ||
(interaction.isMessageComponent() && interaction.componentType !== interactionListener.type) ||
interaction.type !== interactionListener.type
)
return;
if (!interactionListener) return;
if (interaction.isMessageComponent() && interaction.componentType !== interactionListener.type) return;
else if (interaction.type !== interactionListener.type) return;

void interactionListener._run(interaction);
}
Expand Down

0 comments on commit f6bef2b

Please sign in to comment.