Skip to content

Commit

Permalink
fix: try catc
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostdevv committed Dec 10, 2021
1 parent 592abb0 commit c76e69d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/events/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ export default event({
!message.hasThread &&
message.channel.type == 'GUILD_TEXT'
) {
message.channel.threads.create({
name: 'Discussion',
startMessage: message,
});
try {
message.channel.threads.create({
name: 'Discussion',
startMessage: message,
});
} catch {
// we can ignore this error since chances are it will be that thread already exists
}
}
},
});

0 comments on commit c76e69d

Please sign in to comment.