Skip to content

Commit

Permalink
Add auto reaction for no
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinzii authored Nov 12, 2024
1 parent f4a90af commit 9ae257d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/autoreact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ export default class Autoreact extends BotComponent {
this.wheatley.ignorable_error("Unable to find emoji what");
}
}
if (message.content.trim().match(/^no\.?$/gi)) {
// Put an unmanaged non null assertion here because of the precondition requiring that guildId must be
// TCCPP (and thus always a valid guild)
const reaction = message.guild!.emojis.cache.find(emoji => emoji.name === "no");
if (reaction !== undefined) {
await message.react(reaction);
} else {
this.wheatley.ignorable_error("Unable to find emoji no");
}
}
if (message.content.trim().match(/^ok\.?$/gi)) {
await message.react("🆗");
}
Expand Down

0 comments on commit 9ae257d

Please sign in to comment.