How can i create command for reload console // Discord Bot

javascript
#1

Like this command

{
  "install": {
    "include": [
      "^package\\.json$",
      "^\\.env$"
    ]
  },
  "restart": {
    "exclude": [
      "^public/",
      "^dist/"
    ],
    "include": [
      "\\.js$",
      "\\.json"
    ]
  },
  "throttle": 900000
}

In watch.json
But i dont want when i change something in my program then reload console
I just want to reload console without change something in my program
Plzz help me :slight_smile:


MOD EDIT: formatting

1 Like

#2

Hello @Sivonja8,

Do you mean run a console command from your discord bot command that would restart the project from the projects console.
If that is the case, then you can TRY the following:

function execute(command) {
  const exec = require('child_process').exec

  exec(command, (err, stdout, stderr) => {
    process.stdout.write(stdout)
  })
}

execute( "Code to execute")
0 Likes

#3

I want it to be re-loaded automatically with the timer

1 Like

#4

You could use a setTimout function to have it run every certain amount of time!

More info given on discord –

(Javascript solution for others who cannot see discord messages):

setTimeout(restartTimer, 1.8e+6)

function restartTimer() {
client.destroy()
}
0 Likes