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

Identify as a bot #266

Closed atomjack closed 3 years ago

atomjack commented 3 years ago

I recently learned that it is possible for the bot to identify itself as a bot to Turntable. All you have to do is send a websockets message of api: 'user.set_bot'. This is the result in the room list:

screenshot_20210407_092122

I was able to modify the api code by adding this function and then running it after my bot (ChilloutMixerNinja) registered with the room:

  setAsBot(callback) {
    const rq = { api: 'user.set_bot' };
    return this._send(rq, callback);
  }

I could do a pull request but I wasn't sure if this should be built into Turntable-API by default, or should it just be up to the user of the API to run it in order to identify as a bot. @alaingilbert I'd appreciate your input!

alaingilbert commented 3 years ago

I would add the function, but I wouldn't call it automatically.

atomjack commented 3 years ago

Thanks @alaingilbert !