Skip to content

Commit 3f30f20

Browse files
authored
Merge pull request #13 from kdkasad/kian-opt-in
Opt me in to ship/checkpoint messages
2 parents 2c95d57 + ec1e28a commit 3f30f20

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed

src/events/message_create/auto-thread-channels.ts

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const AUTO_THREAD_CHANNELS = [SHIP_CHANNEL_ID, CHECKPOINTS_CHANNEL_ID];
1111
// into phasing this out or doing something different.
1212
// const VALID_PROJECT_LINKS = ["https://github.com/"];
1313

14-
const _CHECKPOINT_RESPONSE_MESSAGES = [
14+
const CHECKPOINT_RESPONSE_MESSAGES = [
1515
"Great checkpoint! :D",
1616
"Nice progress! :D",
1717
"Awesome update! :D",
@@ -32,6 +32,15 @@ const SHIP_RESPONSE_MESSAGES = [
3232
"Boom, nice ship! :D",
3333
];
3434

35+
const CHECKPOINTS_MESSAGE_OPT_IN_USERS = [
36+
"753840846549418024", // kian
37+
];
38+
39+
const SHIP_MESSAGE_OPT_IN_USERS = [
40+
"753840846549418024", // kian
41+
"636701123620634653", // ray
42+
];
43+
3544
export default async function handler(message: Message) {
3645
if (message.author.bot) return;
3746
if (message.channel.isDMBased()) return;
@@ -89,31 +98,39 @@ Cheers! ^•^`;
8998
});
9099

91100
if (message.channelId === CHECKPOINTS_CHANNEL_ID) {
92-
// NOTE: a couple people didn't like this, so it's commented out.
101+
// NOTE: a couple people didn't like this, so it's opt-in.
93102
// can add it back if people come around to it :3
94-
// await thread.send(
95-
// CHECKPOINT_RESPONSE_MESSAGES[
96-
// Math.floor(Math.random() * CHECKPOINT_RESPONSE_MESSAGES.length)
97-
// ],
98-
// );
103+
if (CHECKPOINTS_MESSAGE_OPT_IN_USERS.includes(message.author.id)) {
104+
await Promise.all([
105+
message.react("🎉"),
106+
message.react("✨"),
107+
message.react("🏁"),
108+
thread.send(
109+
`${CHECKPOINT_RESPONSE_MESSAGES[
110+
Math.floor(Math.random() * CHECKPOINT_RESPONSE_MESSAGES.length)
111+
]} 🎉 ✨ 🏁`,
112+
),
113+
]);
114+
}
99115
// TODO(@rayhanadev): integrate potential scrapbook
100116
// TODO(@rayhanadev): add auto-emoji behavior
101117
}
102118

103119
if (message.channelId === SHIP_CHANNEL_ID) {
104-
// await message.react("🎉");
105-
// await message.react("✨");
106-
// await message.react("🚀");
107-
108-
// Keep sending messages for me, I still love you Wack Hacker </3
109-
if (message.author.id === "636701123620634653") {
110-
await thread.send(
111-
`${
112-
SHIP_RESPONSE_MESSAGES[
113-
Math.floor(Math.random() * SHIP_RESPONSE_MESSAGES.length)
114-
]
115-
} 🎉 ✨ 🚀`,
116-
);
120+
// Keep sending messages for some, we still love you Wack Hacker </3
121+
if (SHIP_MESSAGE_OPT_IN_USERS.includes(message.author.id)) {
122+
await Promise.all([
123+
message.react("🎉"),
124+
message.react("✨"),
125+
message.react("🚀"),
126+
thread.send(
127+
`${
128+
SHIP_RESPONSE_MESSAGES[
129+
Math.floor(Math.random() * SHIP_RESPONSE_MESSAGES.length)
130+
]
131+
} 🎉 ✨ 🚀`,
132+
),
133+
]);
117134
}
118135

119136
// TODO(@rayhanadev): integrate potential scrapbook

0 commit comments

Comments
 (0)