Shifts logs

Hello, I've been thinking of adding a command to my bot that logs people's shifts. The concept is that when someone runs the command, it makes an id and logs it in a database, and then the person running the command would be timed. The database thing is not the problem, the problem is that I don't know where to get started. At the end it would also log that shift in a database with how many minutes that person has patrolled on that shift. Can someone point me in the right direction, then the rest I will most likely figure out on my own.
10 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
mallusrgreat
mallusrgreat3mo ago
you could make a command that starts one, i guess
astro
astro3mo ago
Yes, I know that. I'm saying how would the command be structured? How does the bot time the user
mallusrgreat
mallusrgreat3mo ago
probably a timer in the database which is checked every x seconds to see if they're finished like a startTime and an endTime, if Date.now() >= endTime timer goes off
astro
astro3mo ago
I was planning on having a command which ends the patrol altogether
mallusrgreat
mallusrgreat3mo ago
then do that 🤷
astro
astro3mo ago
Oh yeah, how does the Date.now() work, i know it prints out some numbers but what do they mean and how are they determined
mallusrgreat
mallusrgreat3mo ago
how many milliseconds it's been since 1970 jan 1
d.js docs
d.js docs3mo ago
:mdn: Date.now() The Date.now() static method returns the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC.
astro
astro3mo ago
hmm okay Game