Created
April 7, 2019 23:42
-
-
Save winfamy/c1545db13f672dec165310be59751d17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
areTradeSettingsValid: (cookie) => { | |
// Settings to check | |
// https://www.roblox.com/my/settings/json IsAnyBC true | |
// https://accountsettings.roblox.com/v1/inventory-privacy AllUsers | |
// https://accountsettings.roblox.com/v1/trade-value None | |
// https://accountsettings.roblox.com/v1/trade-privacy All | |
return new Promise((resolve, reject) => { | |
const end = (b, key) => { | |
passedChecks[key] = b | |
if (!--left) resolve(passedChecks) | |
} | |
let passedChecks = {} | |
let r = new nodeblox({ cookie }) | |
let neededSettings = { | |
isBC: true, | |
inventoryPrivacy: "AllUsers", | |
tradeValue: "None", | |
tradePrivacy: "All" | |
} | |
let left = Object.keys(neededSettings).length | |
r.fetchIsBC() | |
.then(b => end(b, "isBC")) | |
r.fetchInventoryPrivacy({ shouldMatch: neededSettings.inventoryPrivacy }) | |
.then(b => end(b, "inventoryPrivacy")) | |
r.fetchTradeValue({ shouldMatch: neededSettings.tradeValue }) | |
.then(b => end(b, "tradeValue")) | |
r.fetchTradePrivacy({ shouldMatch: neededSettings.tradePrivacy }) | |
.then(b => end(b, "tradePrivacy")) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment