msg.ts
Version:
MSG is the framework for make discord bot easily
60 lines • 1.54 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const contextHeaderDefaultOptions = {
depth: 0,
};
class ContextHeader {
constructor(options = {}) {
this.isHit = false;
this.hitCommand = null;
this.isFinished = false;
this.currentCommand = null;
const overwrittenOptions = {
...contextHeaderDefaultOptions,
...options,
};
this.depth = overwrittenOptions.depth;
}
getDepth() {
return this.depth;
}
setDepth(depth) {
if (Number.isNaN(depth))
throw new TypeError(`argument 'depth' must be a valid number`);
if (depth < 0)
throw new RangeError(`argument 'depth' must over or same than zero`);
this.depth = depth;
return this;
}
increaseDepth() {
this.depth += 1;
return this;
}
diminishDepth() {
this.depth -= 1;
return this;
}
getIsHit() {
return this.isHit;
}
setHit() {
this.isHit = true;
return this;
}
getHitCommand() {
return this.hitCommand;
}
setHitCommand(hitCommand) {
this.hitCommand = hitCommand;
return this;
}
getIsFinished() {
return this.isFinished;
}
setFinish() {
this.isFinished = true;
return this;
}
}
exports.default = ContextHeader;
//# sourceMappingURL=../../src/dist/class/ContextHeader.js.map