Skip to content

Instantly share code, notes, and snippets.

@winfamy
Created April 7, 2019 23:42
Show Gist options
  • Save winfamy/c1545db13f672dec165310be59751d17 to your computer and use it in GitHub Desktop.
Save winfamy/c1545db13f672dec165310be59751d17 to your computer and use it in GitHub Desktop.
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