edit

.edit() is used to edit the contents of a file in the file manager

.edit(SessionID, path, newContent)

Delete a file or folder in a servers file manager.

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 edit

newContent

string

true

The new content to place in the file

Example:

// Dependencies
const CubedCraft = require('cubed-api');

// Editing the file
CubedCraft.files.edit('SessionID', '/plugins/Skript/scripts/decentskript.sk', 'on load:\n  broadcast "loaded"');

Last updated

Was this helpful?