Skip to content

Commit

Permalink
Make showModal more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
firtoz committed Jan 26, 2023
1 parent 894d8ba commit 9ab4942
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/discord/handlers/DefineModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ export const defineModal = <TInputs extends ModalInput[], TButtonConfig extends
}))

// Show the modal to the user
await interaction.showModal(modal);
return await interaction
.showModal(modal)
.then(() => true, (e) => {
logMessage(`Failed to show modal for id ${id}`, e);

return true;
return false;
});
} catch (e) {
logMessage(`Failed to show modal for id ${id}`, e);

Expand Down

0 comments on commit 9ab4942

Please sign in to comment.