Currently, I am attempting to iterate through a return from an API that supposedly contains an object with a promise within it.
You can find the API documentation here: https://github.com/sentanos/roblox-js/wiki/Main-Functions
This is what my code looks like so far:
var rbx = require('roblox-js');
rbx.login('INF_BOT', '$$$')
.then(function (info) {
console.log('Logged in with ID ' + info.userId)
})
.catch(function (err) {
console.error(err.stack);
});
var Players = rbx.getPlayers(539310, 1, false, -2)
for (var plr in Players) {
console.log(plr);
}
I have never encountered a promise nested within an object before, and I'm uncertain of how to access the returned players from this promise. The API documentation linked above provides some information under the function getPlayers().