So I am making a request to the new twitch API and I'm having trouble getting the data from the response.
{
data:[
{
id:'28793268096',
user_id:'71092938',
game_id:'488552',
community_ids:[
],
type:'live',
title:'NEW EVENT POG ~ twitter.com/xqc',
viewer_count:9143,
started_at:'2018-05-22T17:09:12Z',
language:'en',
thumbnail_url:'https://static-cdn.jtvnw.net/previews-ttv/live_user_xqcow-{width}x{height}.jpg'
},
{
id:'28792267216',
user_id:'23220337',
game_id:'488552',
community_ids:[
Array
],
type:'live',
title:'Overwatch Ranked Season 2 Episode 16: Panic! On The Payload | !charity | !patch',
viewer_count:2332,
started_at:'2018-05-22T15:25:47Z',
language:'en',
thumbnail_url:'https://static-cdn.jtvnw.net/previews-ttv/live_user_emongg-{width}x{height}.jpg'
}
],
pagination:{
cursor:'eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6Mn19'
}
}
Using the code below I'm not getting any data from the array.
var reply = axios.get('https://api.twitch.tv/helix/streams?game_id=488552&type=live&first=2&language=en')
.then(function(response){
var datas = response.data;
//console.log(datas);
for(var i = 0; i < datas.length; i++) {
var cube = datas[i];
for(var j = 0; j < cube.length; j++) {
msg.reply(cube.id);
}
}
}).catch((error) => { console.log(error); });;
Any help would be greatly appreciated.