SceneButton

Plattar API scenebutton Reference

Parent
Imports
NodeJS Imports
const {
  	Scene,
  	SceneButton,
  	Server
} = require('@plattar/plattar-api');
Initialisation
Initialise the SceneButton Object
const button = new SceneButton('your-scene-button-id');
.get()
Populate the object with data
button.get().then((button) => {
	// do something with button
}).catch((error) => {
	// do something with error
});
.update()
Update the object with new data
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

button.attributes.title = 'your-new-scene-button-title';

button.update().then((button) => {
	// do something with button
}).catch((error) => {
	// do something with error
});
.create()
Create a new object
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

button.attributes.title = 'your-new-scene-button-title';

// you must pass the parent object during create function
const parent = new Scene('your-scene-id');

button.create(parent).then((button) => {
	// do something with button
}).catch((error) => {
	// do something with error
});
.delete()
Delete a previous object
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

button.delete().then((button) => {
	// do something with button
}).catch((error) => {
	// do something with error
});