Message periodic scanner

Hey! I am trying to figure out if I there is a better way to handle my case: User can create suggestion on my server. The suggestion is creates using a form and return an embedded message. Each suggestion has and expiry date and users can vote on it, once the expiry date has been reached the suggestion is removed from the channel and moved to approved/ denied channels. All of that is currently working, but I feel that my solution can be improved. Currently the bot scans every x amount of time the messages in the channel and see the suggestions expiry date has reached to handle it. I am trying to find a better way of handling it like cron jobs or another bot that only run scans and triggers actions on the main bot. Thanks you for the help!
2 Replies
d.js toolkit
d.js toolkit2mo 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!
Zuk
ZukOP2mo ago
Ok sounds good. Redis would probably be the fastest for this case,but in the slightest scale or different use case I might want a difference db. Any recommendations for db that integrates well with discord.js Also should the cron run from the bot or from a different service that would trigger an action on the bot? Like a job scheduler and worker Abd thank you!
Want results from more Discord servers?
Add your server