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.
DT
d.js toolkit44d 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
M
mallusrgreat44d ago
you could make a command that starts one, i guess
A
astro44d ago
Yes, I know that. I'm saying how would the command be structured? How does the bot time the user
M
mallusrgreat44d 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
A
astro44d ago
I was planning on having a command which ends the patrol altogether
M
mallusrgreat44d ago
then do that 🤷
A
astro44d 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
M
mallusrgreat44d ago
how many milliseconds it's been since 1970 jan 1
DD
d.js docs44d 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.
A
astro44d ago
hmm okay Game
Want results from more Discord servers?
Add your server
More Posts
DiscordAPIError[10008]: Unknown Message} /root/bots/Synth/node_modules/@discordjs/rest/dist/index.js:640 throw new DiscordAPIError(daim still new to all this and cant install node.js to discord and need some help if possibleim sorry for asking this but all videos are so confusing and dont show all the stepsmember.setNickname or member.roles.add occasionally not workingHi all, What reasons are there for a nickname potentially not being applied, or a role potentially I have an error in my botHello, sorry for the inconvenience, but I have a problem with my bot, since it turns off due to an eButton QuestionHow can i make a button never expire?Commands not refreshing after being correctly deployedGood evening. I'm developing a discord.js bot using typescript. I am having trouble using my deployeguild.guildScheduledEventUserAdd event failing to fire consistentlyI am having an issue with the guildScheduledEventUserAdd event. It seems to trigger sometimes but whWhere do I start from?Hi, Can y'all share some helpful resouces with me so that I can understand and learn about npmjs?? THelp me plsCode: Error: `[WARNING] The command at C:\Users\OE104655\Videos\Eendsmp bot\commands\utility\giveawHelp me plsIdk whats wrong with this line of code: `const client = new Client({ intents: [GatewayIntentBits.Guiis it possible to run command 1 from command 2so like command 1 is /embed title: description: And i want to run that command with pre-set values fHow do I add a role with discord.js```js const target = interaction.options.getUser('target'); const role = interaction.options.getRolecheck if role is set to certain role idshow do i check if the role is set to certain ids? ```js const role = interaction.optHow do you turn on a discord bot?It ain't onErrorroot@VPS-10384:~/7bLogsBot# node index node:internal/modules/cjs/loader:1137 throw err; ^ ErrorTypeErrorCode: `const guild = bot.guilds.cache.get(process.env.GUILD_ID);` Error: `TypeError: Cannot read Modal — PaginationHi! To construct my bot, I wanted to use modals allowing user reply. But my number of fields is moreduplicated interactionsokay i need help, because i have been hititng my head against the wall abt this for days. my interacMaintaining connection after restarting nodeI have a bot that would connect to a channel and play sounds. I have a slash command that would playMessages: combining selectors and input fieldsHey, Is it possible for example with modals or messages to have a combination of inputs for free tex