как сделать что бы бот перезапускался каждые 24 часа или после определенного действия, например, когда в чат написал команду про перезапуск.
function restart() { console.log('Restarting bot...'); process.exit(1); } client.on('message', message => { if (message.content === '!restart') { restart(); } }); cron.schedule('0 0 * * *', () => { // restart 24 hours restart(); }); JS function restart() { console.log('Restarting bot...'); process.exit(1); } client.on('message', message => { if (message.content === '!restart') { restart(); } }); cron.schedule('0 0 * * *', () => { // restart 24 hours restart(); });