Skip to content

Commit

Permalink
remove double api call when canceling memory game
Browse files Browse the repository at this point in the history
Signed-off-by: RedGuy12 <[email protected]>
  • Loading branch information
cobaltt7 committed Aug 13, 2023
1 parent 737f335 commit e59cbf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/games/memoryMatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ export default async function memoryMatch(

if (buttonInteraction.customId.startsWith("cancel-")) {
await buttonInteraction.deferUpdate();
if (isUser || isOtherUser)
if (isUser || isOtherUser) {
await message.edit({ components: disableComponents(message.components) });
return;
collector.stop();
}
}

if (!buttonInteraction.customId.startsWith("confirm-")) return;
Expand Down

0 comments on commit e59cbf2

Please sign in to comment.