1- import dayjs from "dayjs" ;
21import {
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