Skip to content

Commit f77082b

Browse files
Merge pull request #5 from purduehackers:photos-ping
Added photography ping
2 parents 74d273b + 32feb2b commit f77082b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/utils/hack-night.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import dayjs from "dayjs";
21
import {
32
ChannelType,
43
ThreadAutoArchiveDuration,
@@ -39,7 +38,8 @@ export function createHackNightImagesThread(client: Client) {
3938
}
4039

4140
const message = await channel.send({
42-
content: `${HACK_NIGHT_MESSAGES[Math.floor(Math.random() * HACK_NIGHT_MESSAGES.length)]} 🎉\n\nShare your pictures from the day in this thread!`,
41+
content: `${HACK_NIGHT_MESSAGES[Math.floor(Math.random() * HACK_NIGHT_MESSAGES.length)]} 🎉`
42+
+`\n\n<@&1348025087894355979>: Share your pictures from the day in this thread!`,
4343
});
4444

4545
if (!message) {
@@ -49,7 +49,8 @@ export function createHackNightImagesThread(client: Client) {
4949

5050
await message.pin();
5151

52-
const date = dayjs().format("MM/DD");
52+
const dateObj = new Date();
53+
const date = `${(1 + dateObj.getMonth() + "").padStart(2, "0")}/${(dateObj.getDate() + "").padStart(2, "0")}`;
5354

5455
await message.startThread({
5556
name: `Hack Night Images - ${date}`,
@@ -104,7 +105,7 @@ export function cleanupHackNightImagesThread(client: Client) {
104105

105106
const hackNightImageThread = threads.threads
106107
.filter((t) => {
107-
return t.name.startsWith("Hack Night Images");
108+
return t.name.startsWith("Hack Night Images - ");
108109
})
109110
.sorted((a, b) => {
110111
if (!a.createdTimestamp || !b.createdTimestamp) return 0;
@@ -170,11 +171,9 @@ export function cleanupHackNightImagesThread(client: Client) {
170171
.slice(0, 5);
171172

172173
await channel.send({
173-
content: `Our top contributors this week are:
174-
${topContributors
175-
.map(([id, count], index) => `\n#${index + 1}: <@${id}> - ${count}`)
176-
.join("")
177-
.trim()}`,
174+
content: `Our top contributors this week are:\n${topContributors
175+
.map(([id, count], index) => `\n#${index + 1}: <@${id}> - ${count}`)
176+
.join("")}`
178177
});
179178
}
180179

0 commit comments

Comments
 (0)