Built-in Functions

The basic built-in functions do not relate to bot functionality. Instead, they allow writing flexible scripts.

setTimeout(function() {
  console.log("Timer has fired!");
}, 3000); 

List of functions

Script Details

process.name

Read-only property reflecting running script name.

process.release

Read-only property reflecting the script release version (for store scripts).

Program Flow

process.exit

Ends the execution of the program.

process.sleep

Pauses a program execution.

Timer control

Standard timer control routines of JavaScript: setTimeout, setInterval etc.

Persistent Bot Storage

localStorage.get

Restores a string value from a persistent storage.

localStorage.set

Puts a string value into a persistent storage.

localStorage.keys

Returns the list of the available keys in a persistent storage.

localStorage.on

Adds the event callback on localStorage.

User Settings

userSettings.*

Allows accessing the settings specified by the script user.

HTTP

http.get

Retrieves data from a HTTP source.

http.post

Retrieves data from a HTTP source using the POST method.

http.requestWebhookUrl

Allocates a new, per-run webhook URL and token for the current script instance.

Debug

console.log

Logs data to the runtime log.

console.warn

Logs data to the error log.

console.error

Logs data to the error log.

_assert

Logs data to the error log if the assertion is false.