1.2.3 • Published 3 years ago
@polytoria/users v1.2.3
User API!
The user API is a really good way to get and handle data from the polytoria API.
getFromUsername()
Static This function returns user information through the Username.
const User = require('@polytoria/users');
User.getFromUsername('NodeJS').then((result)=>{
console.log(result.Username); // NodeJS
console.log(result.Rank); // ADMINISTRATOR
console.log(result.Description) // NodeJS long ass description lol
})
getFriends();
Function to gather an array of friends of the user.
const Polytoria = new User(1);
const PolyFriends = Polytoria.getFriends().then((friends)=>{
console.log(friends); // [{username: blah blah}, {username: willemstinky}] etc....
})
getUserData();
A function to get all user data.
const Polytoria = new User(1);
const PolyData = Polytoria.getUserData().then((Data)=>{
console.log(Data.Username); // Polytoria
})