Issue
I'm building a Discord bot and when I add commands I want to be able to update the bot without taking it offline. I host this bot on a Raspberry Pi. I don't want it to go offline for a few reasons. The main reason is I have a cooldown system for a command and if the bot resets so does the cooldown and the users then can spam the command. I have tried the Discord.js Guide Reloading commands suggestion (https://discordjs.guide/command-handling/adding-features.html#reloading-commands) but never seemed to work for me since that was for only pre existing commands. Any suggestions and help would be appreciated.
Solution
To fix the cooldown issue use a database like Enmap.
If you want to reload added commands, you must be using a command handler.
Just re-run your command handler's setup code to add and remove commands (usually looks like a fs.readdir
call which handles each command)
Answered By - Logan Devine