UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

38 lines (35 loc) 1.67 kB
'use strict'; var utilities = require('@sapphire/utilities'); var Command_cjs = require('../structures/Command.cjs'); var Enums_cjs = require('../types/Enums.cjs'); var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); function parseConstructorPreConditionsRunIn(runIn, resolveConstructorPreConditionsRunType, preconditionContainerArray) { if (utilities.isNullish(runIn)) return; if (Command_cjs.Command.runInTypeIsSpecificsObject(runIn)) { const messageRunTypes = resolveConstructorPreConditionsRunType(runIn.messageRun); const chatInputRunTypes = resolveConstructorPreConditionsRunType(runIn.chatInputRun); const contextMenuRunTypes = resolveConstructorPreConditionsRunType(runIn.contextMenuRun); if (messageRunTypes !== null || chatInputRunTypes !== null || contextMenuRunTypes !== null) { preconditionContainerArray.append({ name: Enums_cjs.CommandPreConditions.RunIn, context: { types: { messageRun: messageRunTypes ?? [], chatInputRun: chatInputRunTypes ?? [], contextMenuRun: contextMenuRunTypes ?? [] } } }); } } else { const types = resolveConstructorPreConditionsRunType(runIn); if (types !== null) { preconditionContainerArray.append({ name: Enums_cjs.CommandPreConditions.RunIn, context: { types } }); } } } __name(parseConstructorPreConditionsRunIn, "parseConstructorPreConditionsRunIn"); exports.parseConstructorPreConditionsRunIn = parseConstructorPreConditionsRunIn; //# sourceMappingURL=runIn.cjs.map //# sourceMappingURL=runIn.cjs.map