Hey all,
Trying to get a list of all viewers using https://tmi.twitch.tv/group/user/USERNAME/chatters.
I am using a Golang struct to unmarshal the JSON into.
type Viewers struct {
ChatterCount string `json:"chatter_count"`
Chatters []struct {
Viewers []string `json:"viewers"`
} `json:"chatters"`
}
This setup returns empty slices/arrays.
I have another struct for other API data as seen below, which works fine.
type Stream struct {
Data []struct {
ID string `json:"id"`
UserID string `json:"user_id"`
GameID string `json:"game_id"`
CommunityIds []string `json:"community_ids"`
Type string `json:"type"`
Title string `json:"title"`
ViewerCount int `json:"viewer_count"`
StartedAt time.Time `json:"started_at"`
} `json:"data"`
}
Any insight into what I’m missing would be awesome!
UPDATE: Changing the chattercount from string to int is now getting me expected results, but actual list of viewers is still empty.