Utils

Utils methods

Resource Usages

See the resources being used by your server

const ptero = require('lmadactyl')
let result = await ptero.client.utils.resourceUsage("https://yourpanel.com", "apikey", "serverId")
console.log(result) //Object
Parameter
Value

panelURL (Type STRING)

The link to your pterodactyl panel

apiKey (Type STRING)

Type 1

serverId (Type STRING)

Your server ID. (https://yourpanel.com/server/id)

Server Console Command.

Run a command in the console

const ptero = require('lmadactyl')
let result = await ptero.client.utils.sendConsoleCommand("https://yourpanel.com", "apikey", "serverId", "help", true)
console.log(result) //If an error occurs when displaying the console information, it will return 204 (No content)
Parameter
Value

panelURL (Type STRING)

The link to your pterodactyl panel

apiKey (Type STRING)

Type 1

command (Type STRING)

The command you want to run in the console

serverId (Type STRING)

Your server ID. (https://yourpanel.com/server/id)

color (Type BOOLEAN)

If you want to display console colors (Default value: false)

View logs

See your console.

const ptero = require('lmadactyl')
let result = await ptero.client.utils.logs("https://yourpanel.com", "apikey", "serverId", true)
console.log(result) //If an error occurs when displaying the console information, it will return 204 (No content)
Parameter
Value

panelURL (Type STRING)

The link to your pterodactyl panel

apiKey (Type STRING)

Type 1

serverId (Type STRING)

Your server ID. (https://yourpanel.com/server/id)

color (Type BOOLEAN)

If you want to display console colors (Default value: false)

Timeout (Type NUMBER MS)

Enter the time in milliseconds that the websocket connection will be cut off (Default value: 1000 (1 second) (Max time: 3 minutes)

Do not set a high time as it can slow down your computer and increase the resource usage of the machine you are using.

Send signal

Send signal to server

const ptero = require('lmadactyl')
let result = await ptero.client.utils.sendSignal("https://yourpanel.com", "apikey", "serverId", "start")
console.log(result) //204
Parameter
Value

panelURL (Type STRING)

The link to your pterodactyl panel

apiKey (Type STRING)

Type 1

serverId (Type STRING)

Your server ID. (https://yourpanel.com/server/id)

signal (Type STRING)

Signal you want to send to the server Valid signals: start, kill, stop, restart

Server List

Lists all servers that are registered in the user's account

const ptero = require('lmadactyl')
let result = await ptero.client.utils.serverList("https://yourpanel.com", "apikey")
console.log(result)
Parameter
Value

panelURL (Type STRING)

The link to your pterodactyl panel

apiKey (Type STRING)

Type 1

Last updated