const Kahoot = require('kahoot.js-updated') function createClient(i, name, gamePin) { try { var client = new Kahoot; console.log('Joining kahoot... ' + i) var b = name client.join(gamePin, b+i) client.on('questionStart', question => { console.log('A new question has started, answering the first answer.') setTimeout(() => { question.answer(Math.floor(Math.random()*4)) }, Math.random() * 4) }) return client } catch (e) {} } (async() => { let gamePin = '2236050' let jmlBot = 10 for (let i = 0; i < jmlBot; i++) { setTimeout(() => { createClient(i+1, 'Robot Cerdas @ ', gamePin) }, (i*200)) } })()