rimogames-node-client
Version:
62 lines (53 loc) • 1.84 kB
JavaScript
;
import requestPromise from "request-promise-native";
class RimoHub {
constructor() {
this.endpoint = "https://api.gifan.id";
}
getMlbb(userId, zoneId) {
if (!userId || !zoneId) throw new Error("Missing User ID or Zone ID");
return requestPromise({
method: "GET",
uri: this.endpoint + "/trueID/mobileLegends?id=" + userId + "." + zoneId,
json: true
})
.then((username) => {
if (!username) {
throw new Error("Invalid User ID or Zone ID");
} else if (username) {
if (typeof username !== undefined) return username;
}
});
}
getFf(userId) {
if (!userId) throw new Error("Missing User ID");
return requestPromise({
method: "GET",
uri: this.endpoint + "/trueID/freeFire?id=" + userId,
json: true
})
.then((username) => {
if (!username) {
throw new Error("Invalid User ID");
} else if (username) {
if (typeof username !== undefined) return username;
}
});
}
getAov(userId) {
if (!userId) throw new Error("Missing User ID");
return requestPromise({
method: "GET",
uri: this.endpoint + "/trueID/aov?id=" + userId,
json: true
})
.then((username) => {
if (!username) {
throw new Error("Invalid User ID");
} else if (username) {
if (typeof username !== undefined) return username;
}
});
}
}
export default RimoHub;