mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
add fileoutput to eval
This commit is contained in:
parent
3fb5a69561
commit
19edeaaff2
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue