seyfert
Version:
The most advanced framework for discord bots
30 lines (29 loc) • 878 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentCommand = exports.InteractionCommandType = void 0;
const types_1 = require("../types");
exports.InteractionCommandType = {
COMPONENT: 0,
MODAL: 1,
};
class ComponentCommand {
type = exports.InteractionCommandType.COMPONENT;
customId;
/** @internal */
_filter(context) {
if (this.customId) {
const matches = typeof this.customId === 'string' ? this.customId === context.customId : context.customId.match(this.customId);
if (!matches)
return false;
}
if (this.filter)
return this.filter(context);
return true;
}
middlewares = [];
props;
get cType() {
return types_1.ComponentType[this.componentType];
}
}
exports.ComponentCommand = ComponentCommand;