#Scheduling messages through slash commands

6 messages · Page 1 of 1 (latest)

viscid patioBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
astral vale
#

Hello! I currently am trying to work on a feature with my Discord bot that will allow a user to set up a recurring announcement using a slash command. By this I mean that when a user uses the slash command /announcement make, it will allow them to put in a CRON expression for scheduling, as well as a description and attachment for creating the embed attachment that will be posted when the announcement time set by the CRON expression is up.

I'm trying to understand the best way to go about this though. My current idea is to have the slash command add those parameters to a JSON file. Then, when the bot is ready, it will first ensure the schedule is clean using gracefulShutdown and then it will read that JSON file and schedule each job accordingly using a loop. When each new announcement is added, it will repeat this process of cleaning the schedule and readding every job in addition to the new announcement.

This feels like a very roundabout way of accomplishing what I want but I see no other way of doing this. I'm sure I'm missing something extremely crucial but I'm so new to CRON jobs and schedulers that I have no idea. I would greatly appreciate some help! Thank you!

#

(accidentally deleted the original message instead of the duplicate whoops xwx)

potent goblet
#

that's the advice I can give you

astral vale