UNPKG

@zikeji/hypixel

Version:

With IntelliSense support & test coverage, this is an unopinionated async/await API wrapper for Hypixel's Public API. It is developed in TypeScript complete with documentation, typed interfaces for all API responses, built-in rate-limit handling, flexible

51 lines 2 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VanityResources = void 0; const Method_1 = require("../../util/Method"); const ResultObject_1 = require("../../util/ResultObject"); /** * @example * ```typescript * const bingo = await client.resources.vanity.companions(); * ``` * @category Client */ class VanityResources extends Method_1.Method { /** * Retrieve a list of vanity companions. * @example * ```typescript * const companions = await client.resources.vanity.companions(); * ``` * @category API */ companions() { return __awaiter(this, void 0, void 0, function* () { return (0, ResultObject_1.getResultObject)(yield this.client.call("resources/vanity/companions"), ["success", "lastUpdated"]); }); } /** * Retrieve a list of vanity pets. * @example * ```typescript * const pets = await client.resources.vanity.pets(); * ``` * @category API */ pets() { return __awaiter(this, void 0, void 0, function* () { return (0, ResultObject_1.getResultObject)(yield this.client.call("resources/vanity/pets"), ["success", "lastUpdated"]); }); } } exports.VanityResources = VanityResources; //# sourceMappingURL=vanity.js.map