Skip to content

A Failure To DM Is Not A Total Failure #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/interactions/modals/handlers/submit-issue-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,23 @@ export const submitIssueModalHandler: IModalHandler = {
embeds: [issueEmbed],
});

await interaction.user.send({
content: `Your ${issueConfig.longName} was successfully submitted! Here's a copy so you can easily find it later to track progress.`,
embeds: [issueEmbed],
});
try {
await interaction.user.send({
content: `Your ${issueConfig.longName} was successfully submitted! Here's a copy so you can easily find it later to track progress.`,
embeds: [issueEmbed],
});
} catch {
console.error(`Failed to DM ticket to user ${interaction.user.globalName}`);

try {
await interaction.followUp({
content: `Your ${issueConfig.longName} was successfully submitted, but I failed to DM it to you. Use the ticket number link above to track progress.`,
ephemeral: true
});
} catch (error) {
console.error(error);
}
}
},
};

Expand Down