aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/eval.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-05-28 17:37:04 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-05-28 17:37:04 -0400
commitf1cdbd260c6c2249fc0d765949d44d889bcaedc8 (patch)
treea91883fc6de76d739f99c795f1248474df6f1efc /src/commands/dev/eval.ts
parentf3cde793e778d1dc29b704d9cce560c6e929e6e8 (diff)
downloadtanzanite-f1cdbd260c6c2249fc0d765949d44d889bcaedc8.tar.gz
tanzanite-f1cdbd260c6c2249fc0d765949d44d889bcaedc8.tar.bz2
tanzanite-f1cdbd260c6c2249fc0d765949d44d889bcaedc8.zip
I can't read anything
Diffstat (limited to 'src/commands/dev/eval.ts')
-rw-r--r--src/commands/dev/eval.ts32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index 83e63f6..cb7a95c 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -70,32 +70,24 @@ export default class EvalCommand extends BushCommand {
output = eval(code);
output = await output;
if (typeof output !== 'string') output = inspect(output, { depth });
- output = output.replace(
- new RegExp(this.client.token, 'g'),
- '[token omitted]'
- );
+ output = output.replace(new RegExp(this.client.token, 'g'), '[token omitted]');
output = clean(output);
embed
.setTitle('✅ Evaled code successfully')
.addField(
'📥 Input',
code.length > 1012
- ? 'Too large to display. Hastebin: ' +
- (await this.client.util.haste(code))
+ ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code))
: '```js\n' + code + '```'
)
.addField(
'📤 Output',
output.length > 1012
- ? 'Too large to display. Hastebin: ' +
- (await this.client.util.haste(output))
+ ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(output))
: '```js\n' + output + '```'
)
.setColor('#66FF00')
- .setFooter(
- message.author.username,
- message.author.displayAvatarURL({ dynamic: true })
- )
+ .setFooter(message.author.username, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp();
} catch (e) {
embed
@@ -103,25 +95,17 @@ export default class EvalCommand extends BushCommand {
.addField(
'📥 Input',
code.length > 1012
- ? 'Too large to display. Hastebin: ' +
- (await this.client.util.haste(code))
+ ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code))
: '```js\n' + code + '```'
)
.addField(
'📤 Output',
e.length > 1012
- ? 'Too large to display. Hastebin: ' +
- (await this.client.util.haste(e))
- : '```js\n' +
- e +
- '```Full stack:' +
- (await this.client.util.haste(e.stack))
+ ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(e))
+ : '```js\n' + e + '```Full stack:' + (await this.client.util.haste(e.stack))
)
.setColor('#FF0000')
- .setFooter(
- message.author.username,
- message.author.displayAvatarURL({ dynamic: true })
- )
+ .setFooter(message.author.username, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp();
}
if (!silent) {