diff --git a/lib/util/getCurrentUser.js b/lib/util/getCurrentUser.js index c99212cdd..c8becefa3 100644 --- a/lib/util/getCurrentUser.js +++ b/lib/util/getCurrentUser.js @@ -29,8 +29,8 @@ exports.func = async function ({ jar, option }) { constructRequest(`//premiumfeatures.roblox.com/v1/users/${userId}/validate-membership`, jar) ]) - const thumbnail = thumbnailReq.status == "fulfilled" && thumbnailReq.value?.[0].imageUrl - const robux = robuxReq.status == "fulfilled" && robuxReq.value.body?.robux + const thumbnail = thumbnailReq.status == "fulfilled" && thumbnailReq.value[0].imageUrl + const robux = robuxReq.status == "fulfilled" && robuxReq.value.body.robux const premium = premiumReq.status == "fulfilled" && premiumReq.value.body const json = { @@ -50,30 +50,6 @@ exports.func = async function ({ jar, option }) { return json[searchKey] } catch (e) { throw Error("Could not get current user!", e) } - - /*const jar = args.jar - const option = args.option - const httpOpt = { - url: '//www.roblox.com/mobileapi/userinfo', - options: { - resolveWithFullResponse: true, - method: 'GET', - followRedirect: true, - jar - } - } - const res = await http(httpOpt) - if (res.statusCode !== 200) { - throw new Error('You are not logged in.') - } - const json = JSON.parse(res.body) - if (!option) { - return json - } - const searchKey = Object.keys(json).filter((key) => { - return option.toLowerCase() === key.toLowerCase() - })[0] - return json[searchKey]*/ }