kahoot.js icon indicating copy to clipboard operation
kahoot.js copied to clipboard

Issue while looping

Open rectof opened this issue 8 years ago • 4 comments

read below, solved this.

rectof avatar Sep 13 '17 21:09 rectof

nvm im autistic.

I have another issue though, when I try looping the join function, I get this error, I've tried just about everything and cant figure it out. Sorry if this is a hassle lol

events.js:187       throw err;       ^  

Error: Unhandled "error" event. (USER_INPUT)     at WSHandler.emit (events.js:185:19)     at WSHandler.message (C:\Users\Recto\Desktop\discordBots\kahoot\node_modules\kahoot.js\src\WSHandler.js:241:8)     at WebSocket.WSHandler.ws.on.msg (C:\Users\Recto\Desktop\discordBots\kahoot\node_modules\kahoot.js\src\WSHandler.js:26:7)     at emitOne (events.js:115:13)     at WebSocket.emit (events.js:210:7)     at Receiver._receiver.onmessage (C:\Users\Recto\Desktop\discordBots\kahoot\node_modules\ws\lib\WebSocket.js:143:47)     at Receiver.dataMessage (C:\Users\Recto\Desktop\discordBots\kahoot\node_modules\ws\lib\Receiver.js:389:14)     at Receiver.getData (C:\Users\Recto\Desktop\discordBots\kahoot\node_modules\ws\lib\Receiver.js:330:12)     at Receiver.startLoop (C:\Users\Recto\Desktop\discordBots\kahoot\node_modules\ws\lib\Receiver.js:165:16)     at Receiver.add (C:\Users\Recto\Desktop\discordBots\kahoot\node_modules\ws\lib\Receiver.js:139:10)

rectof avatar Sep 15 '17 00:09 rectof

I can help you with this issue right now, this is because the name is the same as another connected user. Use an auto incrementing number.

count = 0;

setInterval(() => {
  count++;
  let name = `Bot-${count}`;
})

dustinrouillard avatar Nov 17 '17 07:11 dustinrouillard

How are you looping through this, also for anyone wondering what the first error was about.

That would be the kahoot room was no longer accessible. I'm gonna make a pull request or maybe even my own module to fix the issues I've found with this.

dustinrouillard avatar Nov 17 '17 07:11 dustinrouillard

I am having the same problem with looping, I have tried multiple ways of making the names different every loop. It just dosen't work. I can't even join twice with totally different names like this:

client.join(00000, "Lorem") client.join(00000, "Ipsum")

And it still dosen't work. I would really appreciate it if you helped me with this.

Ekstropiya avatar Oct 06 '18 07:10 Ekstropiya