Skip to content

Commit

Permalink
make forgor better and improve easter egg code
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 24, 2023
1 parent 401982d commit c0fd650
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions src/events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,26 @@ export default {
if (submissionChannels.includes(message.channel.id)) return;

if (message.content.startsWith(client.tokens.prefix)) return prefixCommandHandler(message);

/**
* easter eggs
*/
switch (message.content.toLocaleLowerCase()) {
case "engineer gaming":
try {
await message.react("👷");
} catch (err) {
/* can't react */
}
break;
return await message.react("👷").catch(() => {});
case "rip":
case "f":
try {
await message.react("🇫");
} catch (err) {
/* can't react */
}
break;
return await message.react("🇫").catch(() => {});
case "band":
case "banding":
["🎤", "🎸", "🥁", "🪘", "🎺", "🎷", "🎹", "🪗", "🎻"].forEach(async (emoji) => {
try {
await message.react(emoji);
} catch (err) {
/* can't react */
}
return ["🎤", "🎸", "🥁", "🪘", "🎺", "🎷", "🎹", "🪗", "🎻"].forEach(async (emoji) => {
await message.react(emoji);
});
break;
case "monke":
case "monkee":
["🎷", "🐒"].forEach(async (emoji) => {
try {
await message.react(emoji);
} catch (err) {
/* can't react */
}
return ["🎷", "🐒"].forEach(async (emoji) => {
await message.react(emoji).catch(() => {});
});
break;
case "hello there":
message
.reply({
Expand Down Expand Up @@ -93,7 +74,7 @@ export default {
.then((message) => message.deleteButton());
}

if (message.content.toLocaleLowerCase().includes("forgor")) await message.react("💀");
if (/\bforgor\b/.test(message.content.toLocaleLowerCase())) await message.react("💀");

/** @todo remove this in a few months when people forgot it existed */
const results = message.content.match(/(?<=\[\#)(.*?)(?=\])/g) ?? [];
Expand Down

0 comments on commit c0fd650

Please sign in to comment.