kient icon indicating copy to clipboard operation
kient copied to clipboard

Get number of subscription gifted

Open checkerlooker opened this issue 1 year ago • 4 comments

Hey, I saw that we have subscription event, and it shows the names of the people who has been gifted.

But is there a way to find out how many subs was given to each of the names, both the host and viewers?

checkerlooker avatar Mar 23 '24 18:03 checkerlooker

As far as I know, Kick gifts one sub per user, I don't believe it gifts multiple, but I actually have no ideabin this regard. In the subscription gifted event, there is a list of usernames that were given subscriptions. In terms of counting how many the gifter has given over all time, I don't believe there is a way to retrieve that information from Kick outside of the leaderboard. This would have to be something you'd track internally within your application.

zSoulweaver avatar Mar 25 '24 21:03 zSoulweaver

Ahh no, I don't mean over the lifetime.

image

I mean for example this. How to detect whether the viewer gifted 30 subs? 50 subs? or Custom Count of subs? In that one instance of gift event

checkerlooker avatar Mar 30 '24 08:03 checkerlooker

I mean for example this. How to detect whether the viewer gifted 30 subs? 50 subs? or Custom Count of subs? In that one instance of gift event

I haven't done enough through testing in this regard. But, based on the event responses I've collected, the gifted subscriptions event will include the gifter name and an array of users who received gifted subscriptions, with that information you can gather what you need.

zSoulweaver avatar Apr 01 '24 22:04 zSoulweaver

client.on(Events.Chatroom.SubscriptionsGifted, async (giftedInstance) => {
            const data = giftedInstance.data;
            const gifter = data.gifter_username;   // Username of the gifter
            const gift_amount = data.gifted_usernames.length;   // Amount of subs gifted
})

colin615 avatar Aug 04 '24 21:08 colin615