alaingilbert / Turntable-API

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

Escorting someone off the stage after Song gets lamed #203

Closed ghost closed 11 years ago

ghost commented 11 years ago

How do you make a bot escort someone off the stage after the current song gets lamed?

sharedferret commented 11 years ago

Not to be "that person," but can you do some research on your own instead of expecting others to build your software for you? This is an API package, so issues opened should concern the API itself, not how to implement features of an application that happen to use that API.

It seems like nearly all the features you want to add have been implemented by other bots, and it would probably be easier to use one of those as a starting point and then add incremental features instead of opening a new issue here for each component of those other bots.

That said, in this case you'd want to do something like:

bot.on('update_votes', function(d) {
  if (d.room.downvotes >= 1) {
    bot.remDj(currentdj);
  }
});

where currentdj is the userid of the DJ currently playing a song (Sparkle stores that ID in djs[0], your implementation may vary).

ghost commented 11 years ago

I have been doing research, but some of the code in the other bots are a bit confusing because some of the bots have database code.

MikeWills commented 11 years ago

I have to say the API documentation has been very good. Better than the javascript framework I am using in my day job. A large portion of my code was from looking at the TTAPI documentation and searching Google/Stackoverflow for the rest. Though I did heavily borrow some more advanced ideas from @sharedferret's bot.

ghost commented 11 years ago

ok, that is nice to know.