Subscription and subscription gift events (EventSub)

Hello everyone,

I have a quick question about the difference between channel.subscribe and channel.subscription.gift events.

If someone gives 10 subs to a Twitch channel, for example, this will normally trigger the gift event, but will it also trigger 10 classic sub events for everyone who wins a sub?

I’m making a counter and I want to make sure I don’t count gifted subs twice.

From what I’ve been able to try with the Twitch CLI, gifts only trigger subscription.gift, but the presence of an isGift property in the channel.subscribe event response makes me doubt this.

Is channel.subscribe only used for gifts to a specific viewer? Which would set isGift to true without triggering the channel.subscription.gift event?

Thanks for your help :slight_smile:

Based on your described use case you likely warrant the use ofchannel.chat.notification instead

channel.subscribe is a “business logic” event, it describes a user changing states (from non sub to sub)

From the docs

The channel.subscription.gift subscription type sends a notification when a user gives one or more gifted subscriptions in a channel.

if you are only counting gift subs then you would use this singular topic only

If you are counting any kind of sub then you want channel.chat.notification and ignore the gift “bomb header” header event and just count subs and resubs.

(it’s unclear what is included in your count)

Thanks for your answer,

I was just looking to count every kind of sub. I wasn’t aware of the chat.notification subscription, i’ll use that instead of the channel.subscribe ! Thanks :slight_smile:

Hi, I’m checking in because I’ve done some testing and from what I’ve observed with “channel.chat.notification,” subs gifts never trigger notice_type ‘sub’ and “resub.” So if I want to count all types of subs, including gifts, I need to check the “sub,” “resub,” and ‘subgift’ notices while ignoring “communitySubGift,” is that right?

communitySubGift is the “header” (x is doing a gift bomb of y gifts)

So yes for your count you would need sub/resub/subgift if thats what you want to include in your count

Okay, that’s perfect for me, thank you. I just have one last question (sorry). From what I can see, sub and resub notifications have an “isGifted” property. But if a gift doesn’t trigger a sub/resub notice type, this property will always be false, right?
Or is there a case where isGifted can be true?
Sorry for all these questions, I’m just trying to make sure I don’t count the same sub multiple times if it appears in two different types of notifications.

For a resub that indicates if the user is sharing a sub that was gifted to them (for example if they were gifted a 6 month sub and they are announcing month 3 for example)

oh ok i see, then i should only check the resub with the isGifted property to false if i also count the sub_gift notice.

Thanks for everything :slight_smile:

You usaully won’t have a sub_gift that day for that sub is the user is sharing. Since if the user sharing their sub is on month 3 or a 6 monther, the sub_giftthat started the sub was 3 months ago. You’ll only have the resub announcement

But if you want to count will depend on a bunch of factors