alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
317 stars 98 forks source link

Little help? Cant even start getting my bot to enter the room... Console just waits.... And nothing ever happens.... Little help #139

Closed p0sixninja closed 11 years ago

p0sixninja commented 11 years ago

My Code Is...

var Bot = require('ttapi');
var AUTH = 'auth+live+sadfasdfsdf';
var USERID = 'asdfsfsadf';
var ROOMID = 'asfsadfsdf';

var bot = new Bot(AUTH, USERID, ROOMID);

bot.on('speak', function (data) {
   // Get the data
   var name = data.name;
   var text = data.text;

   // Respond to "/hello" command
   if (text.match(/^\/hello$/)) {
      bot.speak('Hey! How are you '+name+' ?');
   }
});

And nothing happens ;/

Any help is appreciated

alaingilbert commented 11 years ago

I guess the AUTH, USERID and ROOMID has been replaced ?!

I suggest you to add this little piece of code:

var bot = new Bot(AUTH, USERID, ROOMID);
bot.debug = true;

You should have some traces in your terminal that you can put here after.

p0sixninja commented 11 years ago

Well thank you for your quick response, it seems i have another underlying problem..

I get a message such as...

> ~m~10~m~no_session
< {"api":"user.authenticate","msgid":0,"clientid":"1356830737944-0.5963353429492
1572","userid":"50c7d079eb35c10e339a3adf","userauth":"auth+live+xxx"}
> ~m~30~m~{"msgid": 0, "success": false}
< {"api":"user.get_fan_of","msgid":1,"clientid":"1356830737944-0.596335342949215
72","userid":"50c7d079eb35c10e339a3adf","userauth":"auth+live+xxx"}
< {"api":"room.register","roomid":"50df8cb6eb35c1070b43cd9b","msgid":2,"clientid
":"1356830737944-0.59633534294921572","userid":"50c7d079eb35c10e339a3adf","usera
uth":"auth+live+xxx"}
> ~m~73~m~{"msgid": 2, "err": "Valid userid / userauth required", "success": fal
se}
> ~m~124~m~{"msgid": 1, "fanof": ["50c2a163aaa5cd1650217391", "50c7ddbceb35c10e3
39a3b55", "504ea660eb35c1057a00003d"], "success": true}
< {"api":"presence.update","status":"available","msgid":3,"clientid":"1356830737
944-0.59633534294921572","userid":"50c7d079eb35c10e339a3adf","userauth":"auth+li
ve+xxx"}
> ~m~73~m~{"msgid": 3, "err": "Valid userid / userauth required", "success": fal
se}
p0sixninja commented 11 years ago

i checked the auth and all of my information, everything is to the "t" correct.. Is something not right with the way im doing this?

alaingilbert commented 11 years ago

The auth is clearly invalid.

If your auth does not contain the auth+live+prefix, you shouldn't add it.

p0sixninja commented 11 years ago

I would kiss you on the mouth right now.... You sir... Are so amazing and have made my days hard work paid off... You are a gift my friend!!! <3

alaingilbert commented 11 years ago

ahaha, I'm glad I could help :D