@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
30 lines (28 loc) • 1.27 kB
JavaScript
import { __name } from '../chunk-PAWJFY3S.mjs';
import { container } from '@sapphire/pieces';
import { Identifiers } from '../lib/errors/Identifiers.mjs';
import { AllFlowsPrecondition } from '../lib/structures/Precondition.mjs';
var _CorePrecondition = class _CorePrecondition extends AllFlowsPrecondition {
constructor(context) {
super(context, { position: 10 });
}
messageRun(_, command, context) {
return command.enabled ? this.ok() : this.error({ identifier: Identifiers.CommandDisabled, message: "This message command is disabled.", context });
}
chatInputRun(_, command, context) {
return command.enabled ? this.ok() : this.error({ identifier: Identifiers.CommandDisabled, message: "This chat input command is disabled.", context });
}
contextMenuRun(_, command, context) {
return command.enabled ? this.ok() : this.error({ identifier: Identifiers.CommandDisabled, message: "This context menu command is disabled.", context });
}
};
__name(_CorePrecondition, "CorePrecondition");
var CorePrecondition = _CorePrecondition;
void container.stores.loadPiece({
name: "Enabled",
piece: CorePrecondition,
store: "preconditions"
});
export { CorePrecondition };
//# sourceMappingURL=Enabled.mjs.map
//# sourceMappingURL=Enabled.mjs.map