From 19edeaaff2f2a4b69c2c738df4da6cd11d80e288 Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Thu, 30 Jan 2025 11:28:44 +0100 Subject: [PATCH] add fileoutput to eval --- commands/message/dev/eval.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/commands/message/dev/eval.js b/commands/message/dev/eval.js index 6490c29..ffd5aee 100644 --- a/commands/message/dev/eval.js +++ b/commands/message/dev/eval.js @@ -1,5 +1,6 @@ const { acknowledge } = require("#utils/interactions"); const { codeblock } = require("#utils/markdown"); +const { editOrReply } = require("#utils/message"); const { Utils } = require("detritus-client"); const { DiscordRegexNames } = require("detritus-client/lib/constants"); @@ -19,6 +20,7 @@ module.exports = { }, args: [ { default: false, name: "noreply", type: "bool", help: "Reply with evaluated output" }, + { default: false, name: "fileout", type: "bool", help: "Respond with output as a file" }, { default: 2, name: "jsonspacing", type: "number", help: "Spacing for formatted json" }, { default: true, name: "async", type: "bool", help: "Async evaluation" } ], @@ -54,6 +56,16 @@ module.exports = { const max = 1990 - language.length; if (!args.noreply) { const reply = codeblock(language, [String(message).slice(0, max)]) + if(args.fileout){ + return editOrReply(context, { + files: [ + { + filename: "out.txt", + value: Buffer.from(message) + } + ] + }) + } return context.editOrReply( reply );