Skip to content

Commit

Permalink
fix bf ephemeral
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico040 committed May 3, 2024
1 parent 6a4f86f commit 3aad448
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/bf-eval/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3aad448

Please sign in to comment.