TwitchLib / TwitchLib.Unity

TwitchLib repository representing all code belonging to the implementation of TwitchLib for Unity. Maintained primarily by LuckyNoS7evin.
164 stars 33 forks source link

Clarification on some events #41

Open adamsingle opened 5 years ago

adamsingle commented 5 years ago

I notice that there is the Follower Service that has an OnNewFollowersDetected event. I also notice the the PubSub service has an OnFollow event. I'm trying to make a game that links to a players twitch and can recognise, in game, when the player has a new follower. Will either of these do this? Or are both these events referring to the bots account? Same for things like bits received, is that referring to the bot or the channel? If that is the case, is there a way to authenticate with the players account to do what I'm trying to do?

swiftyspiffy commented 5 years ago

If you want real time data on follow activities, you're likely interested in the pubsub implementation. In that case, Twitch dispatches a message immediately after the follow event and you can act on it.

The follower service basically polls the Twitch API every X seconds and checks if a new follower exists. If you don't need absolute real time, and a couple seconds of latency is ok, this solution is fine.

It basically comes down to how you want your app to work. If you don't mind a persistent connection to Twitch, and require absolute real time, then pubsub solution.

If you don't want to maintain a persistent connection, and want to check in with twitch ever couple seconds, the follower service solution is what you want.

kicksent commented 4 years ago

Can this be closed?