@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
41 lines (39 loc) • 1.36 kB
JavaScript
;
const require_lib_errors_Identifiers = require('../lib/errors/Identifiers.cjs');
const require_lib_structures_Precondition = require('../lib/structures/Precondition.cjs');
let __sapphire_pieces = require("@sapphire/pieces");
//#region src/preconditions/Enabled.ts
var CorePrecondition = class extends require_lib_structures_Precondition.AllFlowsPrecondition {
constructor(context) {
super(context, { position: 10 });
}
messageRun(_, command, context) {
return command.enabled ? this.ok() : this.error({
identifier: require_lib_errors_Identifiers.Identifiers.CommandDisabled,
message: "This message command is disabled.",
context
});
}
chatInputRun(_, command, context) {
return command.enabled ? this.ok() : this.error({
identifier: require_lib_errors_Identifiers.Identifiers.CommandDisabled,
message: "This chat input command is disabled.",
context
});
}
contextMenuRun(_, command, context) {
return command.enabled ? this.ok() : this.error({
identifier: require_lib_errors_Identifiers.Identifiers.CommandDisabled,
message: "This context menu command is disabled.",
context
});
}
};
__sapphire_pieces.container.stores.loadPiece({
name: "Enabled",
piece: CorePrecondition,
store: "preconditions"
});
//#endregion
exports.CorePrecondition = CorePrecondition;
//# sourceMappingURL=Enabled.cjs.map