From 3aad4483bca6cee914587ed5a8659ea22cd787c0 Mon Sep 17 00:00:00 2001 From: Rico040 <93081680+Rico040@users.noreply.github.com> Date: Sat, 4 May 2024 03:29:06 +1000 Subject: [PATCH] fix bf ephemeral --- plugins/bf-eval/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/bf-eval/src/index.ts b/plugins/bf-eval/src/index.ts index 37e30d6..bf3c1a8 100644 --- a/plugins/bf-eval/src/index.ts +++ b/plugins/bf-eval/src/index.ts @@ -44,14 +44,15 @@ export default { }; async function pcommand(args, ctx) { - const program = args[0].value; + const options = new Map(args.map((option) => [option.name, option])); + const program = options.get("code").value; const bf = new Brainfuck(program); let out = ""; bf.on("out", o => out += o); // bf.on("done", () => console.log(out)); bf.init(); - if (args[1].value === false) { + if (options.get("ephemeral")?.value === false) { return { content: out }; } else { sendBotMessage(ctx.channel.id, out);