title: DISCORD.JS restart shard when dies
body: <p>Is there a way to have my shard automatically reconnect when it disconnects? Thanks.</p>
  <pre><code>const { ShardingManager } = require('discord.js')
  const manager = new ShardingManager('./bot.js', { token: &quot;TOKEN&quot;})
  
  manager.on('shardCreate', shard =&gt; {
      console.log(`Launched shard ${shard.id}`)
      shard.on('ready', () =&gt; {
          console.log('Shard ready')
      })
      shard.on('disconnect', (a, b) =&gt; {
          console.log('Shard disconnected')
          console.log(a)
          console.log(b)
      })
      shard.on('reconnecting', (a, b) =&gt; {
          console.log('Shard reconnecting')
          console.log(a)
          console.log(b)
      })
      shard.on('death', (a, b) =&gt; {
          console.log('Shard died')
          console.log(a)
          console.log(b)
      })
  })
  manager.spawn()
  </code></pre>
  <p>My bot randomly crashes it's shards during the night, so I am asking if I can have the shards automatically respawn when it dies. Thank you!</p>