@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
92 lines • 3.46 kB
JavaScript
;
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.SkyBlockResources = void 0;
const Method_1 = require("../../util/Method");
const ResultObject_1 = require("../../util/ResultObject");
const ResultArray_1 = require("../../util/ResultArray");
/**
* @example
* ```typescript
* const achievements = await client.resources.achievements();
* ```
* @category Client
*/
class SkyBlockResources extends Method_1.Method {
/**
* Information regarding the current bingo event and its goals.
* @example
* ```typescript
* const bingo = await client.resources.skyblock.bingo();
* ```
* @category API
*/
bingo() {
return __awaiter(this, void 0, void 0, function* () {
return (0, ResultObject_1.getResultObject)(yield this.client.call("resources/skyblock/bingo"), ["success", "lastUpdated"]);
});
}
/**
* Returns the list of ingame collections.
* @example
* ```typescript
* const collections = await client.resources.skyblock.collections();
* console.log(collections.FARMING);
* ```
* @category API
*/
collections() {
return __awaiter(this, void 0, void 0, function* () {
return (0, ResultObject_1.getResultObject)(yield this.client.call("resources/skyblock/collections"), ["collections"]);
});
}
/**
* Information regarding the current mayor and ongoing election in SkyBlock.
* @example
* ```typescript
* const electionInfo = await client.resources.skyblock.election();
* ```
* @category API
*/
election() {
return __awaiter(this, void 0, void 0, function* () {
return (0, ResultObject_1.getResultObject)(yield this.client.call("resources/skyblock/election"), ["success", "lastUpdated"]);
});
}
/**
* Returns the current items from the SkyBlock gamemode.
* @example
* ```typescript
* const items = await client.resources.skyblock.items();
* ```
* @category API
*/
items() {
return __awaiter(this, void 0, void 0, function* () {
return (0, ResultArray_1.getResultArray)(yield this.client.call("resources/skyblock/items"), "items");
});
}
/**
* Returns the current skills from the SkyBlock gamemode.
* @example
* ```typescript
* const skills = await client.resources.skyblock.skills();
* ```
* @category API
*/
skills() {
return __awaiter(this, void 0, void 0, function* () {
return (0, ResultObject_1.getResultObject)(yield this.client.call("resources/skyblock/skills"), ["skills"]);
});
}
}
exports.SkyBlockResources = SkyBlockResources;
//# sourceMappingURL=skyblock.js.map