@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
36 lines (33 loc) • 1.25 kB
JavaScript
;
var Identifiers_cjs = require('../lib/errors/Identifiers.cjs');
var Precondition_cjs = require('../lib/structures/Precondition.cjs');
var pieces = require('@sapphire/pieces');
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var _CorePrecondition = class _CorePrecondition extends Precondition_cjs.AllFlowsPrecondition {
messageRun(message) {
return message.guild === null ? this.ok() : this.makeSharedError();
}
chatInputRun(interaction) {
return interaction.guildId === null ? this.ok() : this.makeSharedError();
}
contextMenuRun(interaction) {
return interaction.guildId === null ? this.ok() : this.makeSharedError();
}
makeSharedError() {
return this.error({
identifier: Identifiers_cjs.Identifiers.PreconditionDMOnly,
message: "You cannot run this command outside DMs."
});
}
};
__name(_CorePrecondition, "CorePrecondition");
var CorePrecondition = _CorePrecondition;
void pieces.container.stores.loadPiece({
name: "DMOnly",
piece: CorePrecondition,
store: "preconditions"
});
exports.CorePrecondition = CorePrecondition;
//# sourceMappingURL=DMOnly.cjs.map
//# sourceMappingURL=DMOnly.cjs.map