Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 37 additions & 20 deletions src/events/message_create/auto-thread-channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const AUTO_THREAD_CHANNELS = [SHIP_CHANNEL_ID, CHECKPOINTS_CHANNEL_ID];
// into phasing this out or doing something different.
// const VALID_PROJECT_LINKS = ["https://github.com/"];

const _CHECKPOINT_RESPONSE_MESSAGES = [
const CHECKPOINT_RESPONSE_MESSAGES = [
"Great checkpoint! :D",
"Nice progress! :D",
"Awesome update! :D",
Expand All @@ -32,6 +32,15 @@ const SHIP_RESPONSE_MESSAGES = [
"Boom, nice ship! :D",
];

const CHECKPOINTS_MESSAGE_OPT_IN_USERS = [
"753840846549418024", // kian
];

const SHIP_MESSAGE_OPT_IN_USERS = [
"753840846549418024", // kian
"636701123620634653", // ray
];

export default async function handler(message: Message) {
if (message.author.bot) return;
if (message.channel.isDMBased()) return;
Expand Down Expand Up @@ -89,31 +98,39 @@ Cheers! ^•^`;
});

if (message.channelId === CHECKPOINTS_CHANNEL_ID) {
// NOTE: a couple people didn't like this, so it's commented out.
// NOTE: a couple people didn't like this, so it's opt-in.
// can add it back if people come around to it :3
// await thread.send(
// CHECKPOINT_RESPONSE_MESSAGES[
// Math.floor(Math.random() * CHECKPOINT_RESPONSE_MESSAGES.length)
// ],
// );
if (CHECKPOINTS_MESSAGE_OPT_IN_USERS.includes(message.author.id)) {
await Promise.all([
message.react("🎉"),
message.react("✨"),
message.react("🏁"),
thread.send(
`${CHECKPOINT_RESPONSE_MESSAGES[
Math.floor(Math.random() * CHECKPOINT_RESPONSE_MESSAGES.length)
]} 🎉 ✨ 🏁`,
),
]);
}
// TODO(@rayhanadev): integrate potential scrapbook
// TODO(@rayhanadev): add auto-emoji behavior
}

if (message.channelId === SHIP_CHANNEL_ID) {
// await message.react("🎉");
// await message.react("✨");
// await message.react("🚀");

// Keep sending messages for me, I still love you Wack Hacker </3
if (message.author.id === "636701123620634653") {
await thread.send(
`${
SHIP_RESPONSE_MESSAGES[
Math.floor(Math.random() * SHIP_RESPONSE_MESSAGES.length)
]
} 🎉 ✨ 🚀`,
);
// Keep sending messages for some, we still love you Wack Hacker </3
if (SHIP_MESSAGE_OPT_IN_USERS.includes(message.author.id)) {
await Promise.all([
message.react("🎉"),
message.react("✨"),
message.react("🚀"),
thread.send(
`${
SHIP_RESPONSE_MESSAGES[
Math.floor(Math.random() * SHIP_RESPONSE_MESSAGES.length)
]
} 🎉 ✨ 🚀`,
),
]);
}

// TODO(@rayhanadev): integrate potential scrapbook
Expand Down