lucalas / StreamlabsArduinoAlerts

Library to connect to your Streamlabs account and catch all the Twitch events.
8 stars 1 forks source link

Resub Alert not working #5

Closed Billla closed 3 years ago

Billla commented 3 years ago

Hi there! I'm using your library for a while now and really love it! But unfortunately I can't get a Resub event when I send it using streamlabs.com. Is there any way to make it work/add it?

Greetings!

lucalas commented 3 years ago

Hi, I'm really glad that you like it. The resub event can be catched by subscribe event because inside of the event data you can find the sub type and the number of months of subscription and you should implements an algorithm that check these fields. This is the data you receive from a sub/resub:


{
  "type": "subscription",
  "message": [
    {
      "name": "kevin",
      "months": 7,
      "message": "sub message",
      "emotes": null,
      "sub_plan": 1000,
      "sub_plan_name": "Sample Plan name",
      "sub_type": "resub",
      "_id": "a226a8c223634afdc368439c1da7aaba"
    }
  ],
  "for": "twitch_account"
}`
Billla commented 3 years ago

Ah, that's perfect! Thank you! :)