-
Notifications
You must be signed in to change notification settings - Fork 5
User
The ID of the user (String)
The username of the user (String)
When the user joined (String)
When the user last logged in (String)
Profile information like status, country etc. (Object)
- avatar
The main 90x90 avatar for the user (Image)
- avatars
A list of different sizes of avatars for the user (Array<Image>)
- id
The ID of the profile
- status
The "What i'm working on" section of the profile (String)
- bio
The "About me" section of the profile (String)
- country
What country the user set when they first joined (String)
Get all projects by the user. Returns Promise<Array<Project>>
-
options
- fetchAll
Whether to fetch all projects or not NOTE: Can take a while if the user has alot of projects (Boolean)
- limit
Amount of projects to return. Default 20. NOTE: Max is 40, use offset to get more (Number)
- offset
Offset of projects to return. Default 0. (Number)
User.getProjects({
fetchAll: true
}).then(projects => {
console.log(projects);
});
/*
[Project, Project, Project, Project, Project, ...]
*/- project
User.getProject(10128407).then(project => {
console.log("Project title is " + project.title);
});
/*
Project title is Paper Minecraft v11.3 (Minecraft 2D)
*/Get all studios the user is curating. Returns Promise<Array<Studio>>
-
options
- fetchAll
Whether to fetch all studios or not NOTE: Can take a while if the user is curating alot of studios (Boolean)
- limit
Amount of studios to return. Default 20. NOTE: Max is 40, use offset to get more (Number)
- offset
Offset of studios to return. Default 0. (Number)
User.getCurating({
fetchAll: true
}).then(studios => {
console.log(studios);
});
/*
[Studio, Studio, Studio, Studio, Studio, ...]
*/Get all projects the user has favorited. Returns Promise<Array<Project>>
-
options
- fetchAll
Whether to fetch all projects or not NOTE: Can take a while if the user has favorited alot of projects (Boolean)
- limit
Amount of projects to return. Default 20. NOTE: Max is 40, use offset to get more (Number)
- offset
Offset of projects to return. Default 0. (Number)
User.getFavorited({
fetchAll: true
}).then(projects => {
console.log(projects);
});
/*
[Project, Project, Project, Project, Project, ...]
*/Get all users that are following the user. Returns Promise<Array<User>>
-
options
- fetchAll
Whether to fetch all users or not NOTE: Can take a while if the user has alot of followers cough griffpatch cough (Boolean)
- limit
Amount of users to return. Default 20. NOTE: Max is 40, use offset to get more (Number)
- offset
Offset of users to return. Default 0. (Number)
User.getFollowers({
fetchAll: true
}).then(followers => {
console.log(followers);
});
/*
[User, User, User, User, User, ...]
*/Get all users that the user is following. Returns Promise<Array<User>>
-
options
- fetchAll
Whether to fetch all users or not NOTE: Can take a while if the user is following alot of people(Boolean)
- limit
Amount of users to return. Default 20. NOTE: Max is 40, use offset to get more (Number)
- offset
Offset of users to return. Default 0. (Number)
User.getFollowing({
fetchAll: true
}).then(followers => {
console.log(followers);
});
/*
[User, User, User, User, User, ...]
*/User.getMessageCount().then(count => {
console.log("User " + User.username + " has " + count + " messages");
});
/*
User griffpatch has 53781 messages
*/Post a comment on the users profile NOTE: Authorisation required, uses old site-api endpoint, not recommended and is subject to change soon. Returns Promise<>
- content
The content of the comment (String)
- parent
Parent id of comment to reply to (String)
User.postComment("Hi griffpatch!").then(() => {
console.log("griffpatch is happy");
});
/*
griffpatch is happy
*/Report the account NOTE: Authorisation required, uses old site-api endpoint, not recommended and is subject to change soon, I'm not responsible for any negative impact this has on your account. Returns Promise<>
- field
The field that is considered offensive (String) Accepts "description", "working_on", "username", "aboutme", "workingon", "avatar", "name"
User.report("username").then(() => {
console.log("User " + User.username + " has been reported");
});
/*
User griffpatch has been reported
*/