UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

42 lines (40 loc) 1.77 kB
import '../../../../chunk-PAWJFY3S.mjs'; import { Result } from '@sapphire/result'; var PreconditionConditionAnd = { async messageSequential(message, command, entries, context) { for (const child of entries) { const result = await child.messageRun(message, command, context); if (result.isErr()) return result; } return Result.ok(); }, async messageParallel(message, command, entries, context) { const results = await Promise.all(entries.map((entry) => entry.messageRun(message, command, context))); return results.find((res) => res.isErr()) ?? Result.ok(); }, async chatInputSequential(interaction, command, entries, context) { for (const child of entries) { const result = await child.chatInputRun(interaction, command, context); if (result.isErr()) return result; } return Result.ok(); }, async chatInputParallel(interaction, command, entries, context) { const results = await Promise.all(entries.map((entry) => entry.chatInputRun(interaction, command, context))); return results.find((res) => res.isErr()) ?? Result.ok(); }, async contextMenuSequential(interaction, command, entries, context) { for (const child of entries) { const result = await child.contextMenuRun(interaction, command, context); if (result.isErr()) return result; } return Result.ok(); }, async contextMenuParallel(interaction, command, entries, context) { const results = await Promise.all(entries.map((entry) => entry.contextMenuRun(interaction, command, context))); return results.find((res) => res.isErr()) ?? Result.ok(); } }; export { PreconditionConditionAnd }; //# sourceMappingURL=PreconditionConditionAnd.mjs.map //# sourceMappingURL=PreconditionConditionAnd.mjs.map