/bubu-followers

NodeCG Followers Tracker

Primary LanguageJavaScriptMIT LicenseMIT

bubu-followers

This is a meta-bundle for NodeCG. It doesn't provide any display functionality on its own, but it emits events for new followers, and provides a Replicant variable for the latest follower for other bundles to use.

Dependencies

Installation

  1. Install to nodecg/bundles/bubu-followers.
  2. Configure lfg-twitchapi

Usage

This bundle emits the follower event for a new follower, and registers the latestFollower replicant for the latest follower. These have a payload consisting of the Twitch API Follower object.

Sample Config

{
  "username": "twitchname",
  "pollInterval": 30
}

This can also be generated by the nodecg-cli's defaultconfig command.

Example

nodecg.on('follower', function(follower) {
  console.log(follower.user.display_name);
});
var latestFollower = nodecg.Replicant('latestFollower')
latestFollwer.on('change', function(oldVal, newVal) {
  console.log(newVal.user.display_name);
})

License

This project is licensed under the MIT License