Hi!
I have an application where I need to activate a stream overlay whenever a user subscribes. I chose to use EventSub in my serverless backend and consume the " channel.subscribe" event to get the first subscription of a user and the “channel.subscription.message” to get the renewals when the user shares the message (yes, in renewals I only want to get it if he shares the message).
The problem is that when a user renews his subscription I am receiving 2 events, one in “channel.subscription” (I believe it is at the time of payment) and another in “channel.subscription.message”, which is what I really need .
Is there any way to identify this first “channel.subscription” event in these renewal cases? I couldn’t find anything that provides me with this identification, because this first payload comes exactly as a 1 month subscription, without the “cumulative_months”, and when the user shares the message I receive the “cumulative_months” information correctly.
{
"broadcaster_user_id": "123",
"user_name": "acb",
"user_input": "",
"message": "",
"is_anonymous": false,
"bits": 0,
"tier": "1000",
"is_gift": false,
"cumulative_months": 1,
"reward": {}
}
{
"broadcaster_user_id": "123",
"user_name": "acb",
"user_input": "",
"message": {
"text": "",
"emotes": null
},
"is_anonymous": false,
"bits": 0,
"tier": "1000",
"is_gift": false,
"cumulative_months": 13,
"reward": {}
}