Open shawkattack opened 11 years ago
What version of ttapi do you use ?
var repl = require('repl');
var Bot = require('ttapi');
var bot = new Bot('XXXX', 'XXXX');
repl.start('> ').context.bot = bot;
Then...
> bot.roomId
null
> bot.roomRegister('4e6851fa14169c2255108b8c')
undefined
> bot.roomId
'4e6851fa14169c2255108b8c'
> bot.roomDeregister()
undefined
> bot.roomId
null
> bot.roomRegister('4e6851fa14169c2255108b8c')
undefined
> bot.roomId
'4e6851fa14169c2255108b8c'
Everything seems to work properly.
The latest version is 1.5.3
.
I was using 1.5.3 since last night. I checked it again and it still breaks :/
I have been having issues on my android version of TT the past few days switching between rooms. Maybe the problem isn't in the API, but with TT itself.
Frick updated the API to fix the hole we found with sections. I wonder if the API call requires this now?
This is an easy but somewhat urgent fix.
Calling bot.roomRegister does not set the bot's roomId. This causes problems if, for example, you need to call bot.roomInfo later. The bot sends a null, and gets an error code in return from Turntable.
I discovered this issue by calling the bot constructor without a room ID, then calling roomRegister thinking it would handle this for me. Luckily, bot.roomId is publically available to change, so I have a temporary fix by inserting this line
before the call to roomRegister