-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: cookie hunter #140
base: master
Are you sure you want to change the base?
feat: cookie hunter #140
Conversation
cookieHunterChannels: string[]; | ||
currentHuntMessageId: string; | ||
cookieHunterDailyCount: Record<string, number>; | ||
cookieHunterDailyLogChannels: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not random ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not for the V1
Add cookie hunter game base on this idea : https://discord.com/channels/174169014568878080/1220425958050500689/1220425958050500689
The feature: