@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
1 lines • 2.72 kB
Source Map (JSON)
{"version":3,"sources":["../../../src/preconditions/Enabled.ts"],"names":["AllFlowsPrecondition","Identifiers","container"],"mappings":";;;;;;;;AAMO,IAAM,iBAAA,GAAN,MAAM,iBAAA,SAAyBA,qCAAqB,CAAA;AAAA,EACnD,YAAY,OAA6C,EAAA;AAC/D,IAAA,KAAA,CAAM,OAAS,EAAA,EAAE,QAAU,EAAA,EAAA,EAAI,CAAA;AAAA;AAChC,EAEO,UAAA,CAAW,CAAY,EAAA,OAAA,EAAkB,OAAoE,EAAA;AACnH,IAAA,OAAO,OAAQ,CAAA,OAAA,GACZ,IAAK,CAAA,EAAA,KACL,IAAK,CAAA,KAAA,CAAM,EAAE,UAAA,EAAYC,2BAAY,CAAA,eAAA,EAAiB,OAAS,EAAA,mCAAA,EAAqC,SAAS,CAAA;AAAA;AACjH,EAEO,YAAA,CAAa,CAAgC,EAAA,OAAA,EAAkB,OAAoE,EAAA;AACzI,IAAA,OAAO,OAAQ,CAAA,OAAA,GACZ,IAAK,CAAA,EAAA,KACL,IAAK,CAAA,KAAA,CAAM,EAAE,UAAA,EAAYA,2BAAY,CAAA,eAAA,EAAiB,OAAS,EAAA,sCAAA,EAAwC,SAAS,CAAA;AAAA;AACpH,EAEO,cAAA,CAAe,CAAkC,EAAA,OAAA,EAAkB,OAAoE,EAAA;AAC7I,IAAA,OAAO,OAAQ,CAAA,OAAA,GACZ,IAAK,CAAA,EAAA,KACL,IAAK,CAAA,KAAA,CAAM,EAAE,UAAA,EAAYA,2BAAY,CAAA,eAAA,EAAiB,OAAS,EAAA,wCAAA,EAA0C,SAAS,CAAA;AAAA;AAEvH,CAAA;AAtB2D,MAAA,CAAA,iBAAA,EAAA,kBAAA,CAAA;AAApD,IAAM,gBAAN,GAAA;AAwBP,KAAKC,gBAAA,CAAU,OAAO,SAAU,CAAA;AAAA,EAC/B,IAAM,EAAA,SAAA;AAAA,EACN,KAAO,EAAA,gBAAA;AAAA,EACP,KAAO,EAAA;AACR,CAAC,CAAA","file":"Enabled.cjs","sourcesContent":["import { container } from '@sapphire/pieces';\nimport type { ChatInputCommandInteraction, ContextMenuCommandInteraction, Message } from 'discord.js';\nimport { Identifiers } from '../lib/errors/Identifiers';\nimport type { Command } from '../lib/structures/Command';\nimport { AllFlowsPrecondition } from '../lib/structures/Precondition';\n\nexport class CorePrecondition extends AllFlowsPrecondition {\n\tpublic constructor(context: AllFlowsPrecondition.LoaderContext) {\n\t\tsuper(context, { position: 10 });\n\t}\n\n\tpublic messageRun(_: Message, command: Command, context: AllFlowsPrecondition.Context): AllFlowsPrecondition.Result {\n\t\treturn command.enabled\n\t\t\t? this.ok()\n\t\t\t: this.error({ identifier: Identifiers.CommandDisabled, message: 'This message command is disabled.', context });\n\t}\n\n\tpublic chatInputRun(_: ChatInputCommandInteraction, command: Command, context: AllFlowsPrecondition.Context): AllFlowsPrecondition.Result {\n\t\treturn command.enabled\n\t\t\t? this.ok()\n\t\t\t: this.error({ identifier: Identifiers.CommandDisabled, message: 'This chat input command is disabled.', context });\n\t}\n\n\tpublic contextMenuRun(_: ContextMenuCommandInteraction, command: Command, context: AllFlowsPrecondition.Context): AllFlowsPrecondition.Result {\n\t\treturn command.enabled\n\t\t\t? this.ok()\n\t\t\t: this.error({ identifier: Identifiers.CommandDisabled, message: 'This context menu command is disabled.', context });\n\t}\n}\n\nvoid container.stores.loadPiece({\n\tname: 'Enabled',\n\tpiece: CorePrecondition,\n\tstore: 'preconditions'\n});\n"]}