Conversation
| cookieHunterChannels: string[]; | ||
| currentHuntMessageId: string; | ||
| cookieHunterDailyCount: Record<string, number>; | ||
| cookieHunterDailyLogChannels: string[]; |
There was a problem hiding this comment.
what about adding a bit of jsdoc on top of some of these entries?
it may not be obvious what we are storing here without looking at the code
is cookieHunterDailyCount a discord user id <> score record?
what is cookieHunterDailyLogChannels ?
| await cookieMessage.react('🥛'); | ||
| await cookieMessage.react('🍪'); // 1 point for grandma here, she beats everyone who doesn't find her | ||
|
|
||
| setTimeout(() => void dailyHuntEnd(client, cookieMessage), ONE_MINUTE); |
There was a problem hiding this comment.
maybe overkill to manage this now, and i m not sure often the bot crash/restarts. but what happens if the bot crashes? the daily hunt will never stop
a simple fix would be to manage it in countCookies method. when some dude react, you check if the message was posted more than a minute ago and if so, you don't count the point and manually call dailyHuntEnd
There was a problem hiding this comment.
yes I'm not a big fan of this setTimeout too... I will need to store the start time to do that but look like a good solution to avoid an infinite hunt
| jobCurrentlyRunning.stop(); | ||
| } | ||
| jobCurrentlyRunning = new CronJob( | ||
| IT_IS_SNACK_TIME, |
There was a problem hiding this comment.
not for the V1
Add cookie hunter game base on this idea : https://discord.com/channels/174169014568878080/1220425958050500689/1220425958050500689
The feature: