Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bot.roomRegister does not set roomId #137

Open
shawkattack opened this issue Dec 27, 2012 · 4 comments
Open

bot.roomRegister does not set roomId #137

shawkattack opened this issue Dec 27, 2012 · 4 comments

Comments

@shawkattack
Copy link

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

bot.roomId = xxxxxxxxx;

before the call to roomRegister

@alaingilbert
Copy link
Owner

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.

@shawkattack
Copy link
Author

I was using 1.5.3 since last night. I checked it again and it still breaks :/

@MikeWills
Copy link
Contributor

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.

@Izzmo
Copy link
Collaborator

Izzmo commented May 6, 2013

Frick updated the API to fix the hole we found with sections. I wonder if the API call requires this now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants