UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

33 lines (30 loc) 1.45 kB
'use strict'; var pieces = require('@sapphire/pieces'); var Identifiers_cjs = require('../lib/errors/Identifiers.cjs'); var Precondition_cjs = require('../lib/structures/Precondition.cjs'); var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var _CorePrecondition = class _CorePrecondition extends Precondition_cjs.AllFlowsPrecondition { constructor(context) { super(context, { position: 10 }); } messageRun(_, command, context) { return command.enabled ? this.ok() : this.error({ identifier: Identifiers_cjs.Identifiers.CommandDisabled, message: "This message command is disabled.", context }); } chatInputRun(_, command, context) { return command.enabled ? this.ok() : this.error({ identifier: Identifiers_cjs.Identifiers.CommandDisabled, message: "This chat input command is disabled.", context }); } contextMenuRun(_, command, context) { return command.enabled ? this.ok() : this.error({ identifier: Identifiers_cjs.Identifiers.CommandDisabled, message: "This context menu command is disabled.", context }); } }; __name(_CorePrecondition, "CorePrecondition"); var CorePrecondition = _CorePrecondition; void pieces.container.stores.loadPiece({ name: "Enabled", piece: CorePrecondition, store: "preconditions" }); exports.CorePrecondition = CorePrecondition; //# sourceMappingURL=Enabled.cjs.map //# sourceMappingURL=Enabled.cjs.map