Restart app node.js/js


Hello there. I am working on a disord.js bot and I want a command that allows me to shut the bot down and have it automatically. If there was any change in code I would like it to update. I hovever cannot find a way to do this. I am ok downloading a new Node.js application if needed. If someone can find this what would a watch.json look like that doesn’t change at all.


Hey, WilsontheWolf

Here is the easiest way to do that:


My restart bot command:

if (<Message>.content === 'restartthebot') {
  const embed = new Discord.RichEmbed()
    .setDescription(`Restarted in **${Math.floor(}**ms`);
  if ( !== 'Owner's ID') return; => {

If you are on Discord.js [master] just change RichEmbed to MessageEmbed


Thanks Trying it now


Is your project public? I’m interested in what you’re doing but have no context … would love to take a peek. If not public, no worries.



wilsonmusictest is where I have put it in. I am making a discord music bot and sometimes it needs to reboot


That’s really interesting - a kind of use case I wasn’t aware I could handle on glitch (and didn’t know where you meant until I saw it in server.js). Thanks!


Bumb :grimacing:. This only shuts down the bot, doesn’t actually restart it.


You can use the refresh command in the console to restart your project.