-
Notifications
You must be signed in to change notification settings - Fork 7
Project
The ID of the project (String)
The title of the project (String)
The "Notes and Credits" section of the project (String)
The "Instructions" section of the project (String)
Whether the project is visible or not (Boolean)
Whether the project is open to the public or not (Boolean)
Whether comments are able to be posted or not (Boolean)
Whether the project is shared or not (Boolean)
Who the author of the project is (IncompleteUser)
The thumbnail of the project (Image)
An array of different sizes of the thumbnail to use (Array<Image>)
When the project was created (String)
When the project was last modified (String)
When the project was shared.
null
if never been shared (String)
The amount of views the project has (Number)
The amount of loves the project has (Number)
The amount of favorites the project has (Number)
The amount of comments the project has (Number)
The amount of remixes the project has (Number)
The parent project if the project is a remix (Project)
The root project if the project is a remix (Project)
Whether the project is a remix or not (Boolean)
Add a love to the project on behalf of the authorised user. NOTE: Authorisation required. Returns Promise<Boolean>
Project.love().then(isLoved => {
console.log("Project is " + (isLoved ? "loved" : "not loved"));
});
/*
Project is loved
*/
Remove a love for the project on behalf of the authorised user. NOTE: Authorisation required. Returns Promise<Boolean>
Project.unlove().then(isLoved => {
console.log("Project is " + (isLoved ? "loved" : "not loved"));
});
/*
Project is not loved
*/
Add a favorite to the project on behalf of the authorised user. NOTE: Authorisation required. Returns Promise<Boolean>
Project.favorite().then(isFavorited => {
console.log("Project is " + (isFavorited ? "favorited" : "not favorited"));
});
/*
Project is favorited
*/
Remove a favorite for the project on behalf of the authorised user. NOTE: Authorisation required. Returns Promise<Boolean>
Project.unfavorite().then(isFavorited => {
console.log("Project is " + (isFavorited ? "favorited" : "not favorited"));
});
/*
Project is not favorited
*/
Get the inner JSON scripts in the project. If unshared, this method requires authorisation. NOTE: Only works for projects made in Scratch 3.0. Returns Promise<Object>
Project.getScripts().then(scripts => {
console.log(scripts);
});
/*
...
*/
Get all remixes for the projcet. Returns Promise<Array<Project>>
-
options
- fetchAll
Whether to fetch all remixes or not NOTE: Can take a while if the project has alot of remixes (Boolean)
- limit
Amount of remixes to return. Default 20. NOTE: Max is 40, use offset to get more (Number)
- offset
Offset of remixes to return. Default 0. (Number)
Project.getRemixes({
fetchAll: true
}).then(projects => {
console.log(projects);
});
/*
[Project, Project, Project, Project, Project, ...]
*/
Get all studios that the project is in. Returns Promise<Array<Studio>>
-
options
- fetchAll
Whether to fetch all studios or not NOTE: Can take a while if the project is in 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)
Project.getStudios({
fetchAll: true
}).then(studios => {
console.log(studios);
});
/*
[Studio, Studio, Studio, Studio, Studio, ...]
*/
Get all studios that the project is in. Returns Promise<Array<ProjectComment>>
-
options
- fetchAll
Whether to fetch all comments or not NOTE: Can take a while if the project has alot of comments (Boolean)
- limit
Amount of comments to return. Default 20. NOTE: Max is 40, use offset to get more (Number)
- offset
Offset of comments to return. Default 0. (Number)
Project.getComments({
fetchAll: true
}).then(comments => {
console.log(comments);
});
/*
[ProjectComment, ProjectComment, ProjectComment, ProjectComment, ProjectComment, ...]
*/
Post a comment to the project on behalf of the authorised user. NOTE: Authorisation required. Returns Promise<>
- content
The entire text to comment (String)
- parent
The parent id of the comment (String)
Project.postComment("Great project!").then(() => {
console.log("Posted comment!");
});
/*
Posted comment!
*/
Turn off commenting for the project. NOTE: Authorisation required. Returns Promise<Project>
Project.turnOffCommenting().then(newProject => {
console.log("Are comments allowed????????? - " + (newProject.commentsAllowed ? "yes" : "nop"));
});
/*
Are comments allowed????????? - nop
*/
Turn on commenting for the project. NOTE: Authorisation required. Returns Promise<Project>
Project.turnOnCommenting().then(newProject => {
console.log("Are comments allowed????????? - " + (newProject.commentsAllowed ? "yes" : "nop"));
});
/*
Are comments allowed????????? - yes
*/
Toggle commenting for the project. NOTE: Authorisation required. Returns Promise<Project>
Project.toggleCommenting().then(newProject => {
console.log("Are comments allowed????????? - " + (newProject.commentsAllowed ? "yes" : "nop"));
});
/*
Are comments allowed????????? - yes/nop???
*/
Report the project. NOTE: Authorisation required, I am not responsible for any negative impacts this has on your account. Returns Promise<>
- category
Category to report the project for. (Number)
Project.report(8, "Offensive images inside the project.", "...").then(() => {
console.log("Making scratch a better place!"));
});
/*
Making scratch a better place!
*/
Get all assets for the project. NOTE: Authorisation required, Not reccomended, further testing needed, only works for Scratch 3.0 projects. Returns Promise<Array<ScratchImageAsset, ScratchSoundAsset>>
Project.getAllAssets().then(assets => {
console.log(assets);
});
/*
[ScratchImageAsset, ScratchImageAsset, ScratchImageAsset, ScratchSoundAsset, ScratchSoundAsset, ..]
*/