seyfert
Version:
The most advanced framework for discord bots
82 lines (81 loc) • 3.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationShorter = void 0;
const client_1 = require("../../client");
const base_1 = require("./base");
class ApplicationShorter extends base_1.BaseShorter {
/**
* Lists the emojis for the application.
* @param applicationId The ID of the application.
* @returns The emojis.
*/
listEmojis(applicationId) {
return this.client.proxy.applications(applicationId).emojis.get();
}
/**
* Gets an emoji for the application.
* @param applicationId The ID of the application.
* @param emojiId The ID of the emoji.
* @returns The emoji.
*/
getEmoji(applicationId, emojiId) {
return this.client.proxy.applications(applicationId).emojis(emojiId).get();
}
/**
* Creates a new emoji for the application.
* @param applicationId The ID of the application.
* @param body.name The name of the emoji.
* @param body.image The [image data string](https://discord.com/developers/docs/reference#image-data) of the emoji.
* @returns The created emoji.
*/
createEmoji(applicationId, body) {
return this.client.proxy.applications(applicationId).emojis.post({ body });
}
/**
* Lists the entitlements for the application.
* @param applicationId The ID of the application.
* @param [query] The query parameters.
*/
listEntitlements(applicationId, query) {
return this.client.proxy
.applications(applicationId)
.entitlements.get({ query })
.then(et => et.map(e => client_1.Transformers.Entitlement(this.client, e)));
}
/**
* Consumes an entitlement for the application.
* @param applicationId The ID of the application.
* @param entitlementId The ID of the entitlement.
*/
consumeEntitlement(applicationId, entitlementId) {
return this.client.proxy.applications(applicationId).entitlements(entitlementId).consume.post();
}
/**
* Creates a test entitlement for the application.
* @param applicationId The ID of the application.
* @param body The body of the request.
*/
createTestEntitlement(applicationId, body) {
return this.client.proxy
.applications(applicationId)
.entitlements.post({ body })
.then(et => client_1.Transformers.Entitlement(this.client, et));
}
/**
* Deletes a test entitlement for the application.
* @param applicationId The ID of the application.
* @param entitlementId The ID of the entitlement.
*/
deleteTestEntitlement(applicationId, entitlementId) {
return this.client.proxy.applications(applicationId).entitlements(entitlementId).delete();
}
/**
* Lists the SKUs for the application.
* @param applicationId The ID of the application.
* @returns The SKUs.
*/
listSKUs(applicationId) {
return this.client.proxy.applications(applicationId).skus.get();
}
}
exports.ApplicationShorter = ApplicationShorter;