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

Ban artists #197

Closed ghost closed 11 years ago

ghost commented 11 years ago

How do you make the bot ban artists, so when someone plays that banned artist, they get booted out of the room.

MikeWills commented 11 years ago

Booting out of the room is a bit extreme, IMO. I would just remove from the table. Your best bet is to regex the artist name on new song and if the artist is banned, boot from the table.

technobly commented 11 years ago

I typically find this is a nice catch all, since sometimes the artist and title are only in the title, or only in the artist.

to ban an certain song from an artist (AND them together)

teststring = artist + " " + title;
if ( teststring.match(/(?=.*skrillex)(?=.*monsters)/i) )
  bot.remDj(current_dj);

if you want to ban just the artist

if ( teststring.match(/skrillex/i) )
  bot.remDj(current_dj);

or a group of artists (OR operation)

if ( teststring.match(/skrillex|psy|knife party/i) )
  bot.remDj(current_dj);
ghost commented 11 years ago

ok, Thank you for the help. This answers my question.

samuri51 commented 11 years ago

i see you have forked my bot on github.... if you are using it simply add artist names in the setup

ghost commented 11 years ago

ok, thanks for the info.