aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/eval.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-17 10:25:46 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-17 10:25:46 -0400
commitd1724227abfb8f0fcd9e573f7e9772cf0be8257a (patch)
tree52c9dbae1fbbbd3c777d9c16ab643c477141ae21 /src/commands/dev/eval.ts
parent53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3 (diff)
downloadtanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.gz
tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.bz2
tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.zip
honestly no idea what I did at this point
Diffstat (limited to 'src/commands/dev/eval.ts')
-rw-r--r--src/commands/dev/eval.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index f3a30ab..76a78ba 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -20,7 +20,7 @@ export default class EvalCommand extends BushCommand {
aliases: ['eval', 'ev'],
category: 'dev',
description: {
- content: 'Use the command to eval stuff in the bot.',
+ content: 'Evaluate code.',
usage: 'eval [--depth #] <code> [--sudo] [--silent] [--delete] [--proto] [--hidden] [--ts]',
examples: ['eval message.guild.name', 'eval this.client.ownerID']
},
@@ -72,7 +72,6 @@ export default class EvalCommand extends BushCommand {
}
}
],
- ownerOnly: true,
slash: true,
slashOptions: [
{
@@ -117,7 +116,8 @@ export default class EvalCommand extends BushCommand {
type: 'BOOLEAN',
required: false
}
- ]
+ ],
+ ownerOnly: true
});
}
@@ -141,8 +141,8 @@ export default class EvalCommand extends BushCommand {
}
const code: { js?: string | null; ts?: string | null; lang?: 'js' | 'ts' } = {};
args.code = args.code.replace(/[“”]/g, '"');
- args.code = args.code.replace(/```/g, '');
- if (args.typescript) {
+ args.code = args.code.replace(/```*(?:js|ts)?/g, '');
+ if (args.typescript || message) {
code.ts = args.code;
code.js = transpile(args.code);
code.lang = 'ts';