alaingilbert / Turntable-API

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

getting user id's of people as they join? #97

Closed samuri51 closed 12 years ago

samuri51 commented 12 years ago

hey my question is how would i get the user id of people as they join the room? i need that to be able to display a personalized greeting message. also how do i get the user id of the current djing dj. i see there is a data parameter that is read from, is there anyway for me to view the options in data? thanks for any help you can give.

alaingilbert commented 12 years ago
bot.on('registered', function (data) {
  var user = data.user[0];
  bot.speak('Welcome in the room : ' + user.name);
});

The data that you receive is there : https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js

To get the current dj id, you can get it when you first enter the room. That is the data that you'll receive : https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js (search for current_dj) After that, each time a new song start, you receive a newsong event. (https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)

samuri51 commented 12 years ago

thanks a lot man i was really stumped