Chat bot that can see and react to new follower event

Hello. I am currently learning node.js by making my own twitch chat bot.

On my streamelements overlay. I have a custom followers label. This shows the ‘currentfollowers’ and ‘followergoal’ variables in the format x / y
An example would be:
follower goal: 43 / 100

When someone follows my channel. I would like to have my chat bot increment the StreamElements counter ‘currentfollowers’ by 1.

The simplest (and least attractive, messiest) way to do this would be:

  1. My bot becomes aware that someone new has followed.
  2. StreamElements can communicate with my bot via twitch chat.
  3. my bot increments the StreamElements ‘currentfollowers’ counter via chat,

The Problem:

  1. I am unsure of how my own bot can become aware of the new follower event. Either through the twitch API or StreamElements API.

Additionally:
When I reach a milestone, for example, 100 followers. I would like the bot to automatically increment ‘followgoal’ by 10. It would continously keep doing this so I wouldn’t need too.

Preferably. This could all be done with an interaction ‘behind the scenes’ between my chatbot and streamelements, directly, without using twitch-chat as a middle-man. As there are obvious issues with that:

  1. would not be suitable for multiple follower events in a short time-frame.
  2. bot cannot post the same message twice.

Hopefully someone experienced can send me in the right direction. Thank you.

To get new followers you need

Or to

This forum cannot help or advise on Streamelements, since this is the Twitch API support forum

I have considered using a webhook. However I couldn’t find documentation or usage examples on how to implement this.

I just linked to the documentation

Heres a server example that covers recieveing webhook events and handling it’s callback/setup event

https://github.com/BarryCarlyon/twitch_misc/tree/master/webhooks/handlers/js

Doesn’t do the initial POST request(s) to make/manage subscriptions

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.