My goal is to make a feature where an user can “steal” a VIP from the least Active VIP on channel, which is the one that haven’t watched the stream for the longest time.
For that I was trying to make a chatbot that will know when a VIP join the chat and save in a local Database the current time. So I ended up with two solutions:
Get when an User joins chat and, if it’s a VIP, save on DB (Will have problems on 1k Viewers+ Streams).
Questions:
For 1. I don’t know how to use this “onJoin” event and if it really worth it due to it’s limitations
For 2. I want to know what is the frequency that this information is updated
Are those good solutions? Any other way you may suggest? Will I have privacy issues by handling this data?
Your use case suggests logging the time of the users last message in chat.
Since it would make more sense (to me) to recycle the badge from lurkers to active chat members. And active chat members are those talking in chat, not lurking.
To get a list of VIPS you either need an internal list (which you’d have as you are giving them out) or call /vips and parse the result
Actually we were looking for a way to include the lurkers as well, hard to explain haha.
For the talking chat members your solution is perfect, but for the lurkers I know only the /chatters endpoint. Maybe I could use the chat messages as my main source of information and hit the endpoint from time to time as an addition. (Not aiming for an hour level precision, a daily log should do it). Tank You for the help, btw.