read
.read() will read a file and return it's contents and name.
.read(SessionID, path)
Gets the contents of a file.
Parameter
Type
Required
Description
SessionID
string
true
The session ID that you want to perform this action on
path
string
true
The path of the file you wish to read
Example:
// Dependencies
const CubedCraft = require('cubed-api');
// Reading the file
CubedCraft.files.read('SessionID', '/plugins/Skript/scripts/hi.sk').then(file => {
console.log(file);
});
Example Response:
{
title: 'hi.sk',
content: 'command /hi:\r\n trigger:\r\n send "hi"'
}
Last updated
Was this helpful?