Skip to content

Commit

Permalink
Fix crash when reacting to a message fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Token07 committed Aug 29, 2024
1 parent 3e0edb7 commit 0c0f99c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/AutoReact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ export default class AutoReact {

// If original thinking user
if (this.thinkingUsers.indexOf(message.author.id) !== -1) {
message.react("🤔");
message.react("🤔").catch();
return;
}

// Otherwise use our custom ones
const emoji = message.guild!.emojis.cache.filter((x: Discord.Emoji) => x.name !== null && this.isThinkingEmojiName(x.name)).random();
if (emoji) {
message.react(emoji);
message.react(emoji).catch();
return;
}
}
Expand Down Expand Up @@ -240,7 +240,7 @@ export default class AutoReact {
return;
}

message.react(`${this.greetingEmoji.id}`);
message.react(`${this.greetingEmoji.id}`).catch();
}

private isThinkingEmojiName(emojiName: string) {
Expand Down

0 comments on commit 0c0f99c

Please sign in to comment.