hennus-api
Version:
Esta es una libreria para el bot Hennus
27 lines (26 loc) • 786 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseRestFunction = void 0;
const rest_1 = require("@discordjs/rest");
const types_1 = require("../types");
class BaseRestFunction {
constructor(client) {
this.cdn = new rest_1.CDN("https://cdn.discordapp.com/");
this.api = new rest_1.REST().setToken(client.token);
}
;
async _get(type, req, ...args) {
const l = (0, types_1.GetRoutes)(type, ...args);
const data = await this.api.get(l, req);
return data;
}
;
async _post(type, req, ...args) {
const l = (0, types_1.postRoutes)(type, ...args);
const data = await this.api.post(l, req);
return data;
}
;
}
exports.BaseRestFunction = BaseRestFunction;
;