Skip to content

Commit

Permalink
fix: uncaught promise crash in !travel (#1068)
Browse files Browse the repository at this point in the history
* fix: uncaught promise crash in !travel

* fix: properly catch the error
  • Loading branch information
geisterfurz007 authored Aug 30, 2023
1 parent cc2dab3 commit d274093
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/programs/tickets/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ const hasTicket = async (message: Message, channelName: string) => {
);
if (!channel) return false;

message.author.createDM().then((channel) => {
channel.send(
const dm = await message.author.createDM();

try {
await dm.send(
"You already have a ticket open, please close that one first before opening another."
);
});
} catch (e) {
/* Locked down DMs */
}
return true;
};

Expand Down

0 comments on commit d274093

Please sign in to comment.