UNPKG

pterodactyl-manager

Version:

A powerful and easy-to-use API wrapper for Pterodactyl's API, providing a seamless integration of server management and user administration functionalities.

16 lines (14 loc) 563 B
const getServer = require('../Servers/getServer'); module.exports = async function createFolder(url, headers, query, apiKey, body) { try { const server = await getServer(url, headers, query) const response = await fetch(`${url}/api/client/servers/${server.attributes.identifier}/files/create-folder`, { method: "POST", headers: {...headers, Authorization: `Bearer ${apiKey}`}, body: JSON.stringify(body) }); return await response.text() } catch (err) { console.log(err); } };