UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

29 lines (27 loc) 1.44 kB
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 { messageRun(message) { return Reflect.get(message.channel, "nsfw") === true ? this.ok() : this.error({ identifier: Identifiers.PreconditionNSFW, message: "You cannot run this message command outside NSFW channels." }); } async chatInputRun(interaction) { const channel = await this.fetchChannelFromInteraction(interaction); return Reflect.get(channel, "nsfw") === true ? this.ok() : this.error({ identifier: Identifiers.PreconditionNSFW, message: "You cannot run this chat input command outside NSFW channels." }); } async contextMenuRun(interaction) { const channel = await this.fetchChannelFromInteraction(interaction); return Reflect.get(channel, "nsfw") === true ? this.ok() : this.error({ identifier: Identifiers.PreconditionNSFW, message: "You cannot run this command outside NSFW channels." }); } }; __name(_CorePrecondition, "CorePrecondition"); var CorePrecondition = _CorePrecondition; void container.stores.loadPiece({ name: "NSFW", piece: CorePrecondition, store: "preconditions" }); export { CorePrecondition }; //# sourceMappingURL=NSFW.mjs.map //# sourceMappingURL=NSFW.mjs.map