detritus-client
Version:
A Typescript NodeJS library to interact with Discord's API, both Rest and Gateway.
29 lines (28 loc) • 890 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StageInstances = void 0;
const basecollection_1 = require("./basecollection");
const constants_1 = require("../constants");
;
/**
* Stage Instances Reference Collection
* @category Collections
*/
class StageInstances extends basecollection_1.BaseClientGuildReferenceCache {
constructor() {
super(...arguments);
this.key = constants_1.DetritusKeys[constants_1.DiscordKeys.STAGE_INSTANCES];
}
insert(stageInstance) {
if (this.enabled) {
const guild = stageInstance.guild;
if (guild) {
guild.stageInstances.set(stageInstance.id, stageInstance);
}
}
}
get [Symbol.toStringTag]() {
return `Stage Instances (${this.size.toLocaleString()} items)`;
}
}
exports.StageInstances = StageInstances;