goblox.js
Version:
Unoffical ROBLOX API wrapper made by Fastering18.
21 lines (17 loc) • 576 B
JavaScript
/**
* validUser.js
* get user from id, usually to check if user exist
*/
const requests = require("../util/baseRequest")
const endpoints = require("../util/endpoints")
const UserUtil = {}
UserUtil.getUserFromId = (id) => {
return new Promise((resolve, reject) => {
new requests(`${endpoints.userinfo}/${id}`).json().get().then(akun => {
akun = JSON.parse(akun)
if (!akun || !akun.name) return reject("User not found");
return resolve(akun)
}).catch(reject);
})
}
module.exports = UserUtil;