Help canceling a command

SShaLin2/24/2023
Here the code I have for a simple reminder command.https://pastebin.com/crRSdjEn. It works but id like to be able to cancel a specific reminder / list the current active reminders. Can someone explain how the code is being run? My current thought would be that the class only has one instance but the async method can have multiple independent instances. How would I go about soring a list of all of the current reminders / canceling said reminders
Solution
FFavna2/24/2023
reminders like that won't work at all because you need to reply within 3 seconds and even if you defer then you need to reply within 15 minutes so a reminder could never be longer than that. You need to completely rework this and use a proper queuing/scheduling system, use an external database to store reminders and write some way to check if a reminder has expired and only then send it to the user.
SShaLin2/24/2023
Im a bit confused now. I was able to make a reminder for 4 hours later and it worked perfectly, would that break if more than one reminder was made at a time?
SShaLin2/24/2023
I reply with a confirmation message
SShaLin2/24/2023
and then send a follow up ping at the set time
FFavna2/24/2023
oh well anyway you should still not do reminders like this
FFavna2/24/2023
and outside of returning or throwing an error you cannot cancel a command, but doing either of those would also kill the timer
FFavna2/25/2023
Marked my original message as the solution because ultimately that still does cover it.
AArarou2/26/2023
I recommend using a database for when reminders end and not using setTimeout since if the bot restarts the reminder is gone
SShaLin2/26/2023
Is there a specific database framework that you would recommend
FFavna2/26/2023
Prisma
AArarou2/26/2023
^
Kkaname-png2/26/2023
mikro-orm