Find Chatter Info with tmi.js

I currently have a bot using tmi that reads chat messages and what user sent them. When a message comes in it saves some user info in a json called context. It has things like: { 'badge-info': 'subscriber/34', badges: { broadcaster: '1', subscriber: '12' }, 'client-nonce': '', color: '', 'display-name': 'rudeoff', emotes: null, flags: null, id: '', mod: false, 'room-id': '', subscriber: true, 'tmi-sent-ts': '', turbo: false, 'user-id': '', 'user-type': null, 'emotes-raw': null, 'badges-raw': '', username: 'rudeoff', 'message-type': 'chat' }

Was just wondering how I should take this info and try to find how long the chatter has been following the channel. Will I need to do a fetch with their user id?

You need to use the Get User Follows endpoint: https://dev.twitch.tv/docs/api/reference#get-users-follows

Make a request with the to_id param being the channel that the user is chatting it, and the from_id being the users id, and the results will include a timestamp of when they followed.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.