How to perform an action after 24h? (not using setTimeout)

3762 views javascript

I have a Discord bot that has a punish command, and I want to make the bot remove the punishment after 24 hours/1 day. Don't want to use setTimeout() because the bot can go down between that period and setTimeout() consumes resources. How to do that? Thank you.

answered question

1 Answer


upon punishment, a variable can be assigned as When they log in and the current Date is greater than this value, the ban will end.

posted this

Have an answer?


Please login first before posting an answer.