UNPKG

pterowrap

Version:

A node.js wrapper for Pterodactyl API

34 lines (33 loc) 1.14 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Nest_1 = __importDefault(require("../../structures/application/Nest")); const Util_1 = __importDefault(require("../../utils/Util")); class NestManager { constructor(client) { this.client = client; } list(options = {}) { return new Promise(async (resolve, reject) => { try { resolve(await Util_1.default.handlePagination(this.client, "nests", options, Nest_1.default)); } catch (e) { reject(e); } }); } get(id, options = {}) { return new Promise(async (resolve, reject) => { try { resolve(new Nest_1.default(this.client, await this.client.call({ endpoint: "nests/" + id, parameters: options }))); } catch (e) { reject(e); } }); } } exports.default = NestManager;