Skip to content

Commit

Permalink
add: fail handling for translations
Browse files Browse the repository at this point in the history
  • Loading branch information
maamokun committed Dec 12, 2024
1 parent 6641036 commit 0920fda
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/handlers/flagTranslation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export async function translateMessage(reaction: MessageReaction, user: User) {
const result = await translate
.translate(message.content, language)
.catch((error) => {
message.reactions.removeAll();
message.react("❌");
console.error("Translation error: ", error);
return null;
});
Expand Down

0 comments on commit 0920fda

Please sign in to comment.