aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/eval.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-05-28 20:13:49 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-05-28 20:13:49 -0400
commit25cf269e2e793de5fefb9aa3f19fb167168e06c6 (patch)
treecd5f2f3c097a84a2483a70b57b3cbba7b6f4a6be /src/commands/dev/eval.ts
parente220f8462bbfb26e3237df34923be4acc5d83fee (diff)
downloadtanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.gz
tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.bz2
tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.zip
stuff
Diffstat (limited to 'src/commands/dev/eval.ts')
-rw-r--r--src/commands/dev/eval.ts31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index cb7a95c..cfe75cc 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -5,10 +5,7 @@ import { inspect, promisify } from 'util';
import { exec } from 'child_process';
const clean = (text) => {
- if (typeof text === 'string')
- return text
- .replace(/`/g, '`' + String.fromCharCode(8203))
- .replace(/@/g, '@' + String.fromCharCode(8203));
+ if (typeof text === 'string') return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203));
else return text;
};
@@ -50,10 +47,7 @@ export default class EvalCommand extends BushCommand {
});
}
- public async exec(
- message: Message,
- { depth, code, silent }: { depth: number; code: string; silent: boolean }
- ): Promise<void> {
+ public async exec(message: Message, { depth, code, silent }: { depth: number; code: string; silent: boolean }): Promise<void> {
const embed: MessageEmbed = new MessageEmbed();
try {
@@ -74,30 +68,15 @@ export default class EvalCommand extends BushCommand {
output = clean(output);
embed
.setTitle('✅ Evaled code successfully')
- .addField(
- '📥 Input',
- code.length > 1012
- ? '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))
- : '```js\n' + output + '```'
- )
+ .addField('📥 Input', code.length > 1012 ? '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)) : '```js\n' + output + '```')
.setColor('#66FF00')
.setFooter(message.author.username, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp();
} catch (e) {
embed
.setTitle('❌ Code was not able to be evaled')
- .addField(
- '📥 Input',
- code.length > 1012
- ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code))
- : '```js\n' + code + '```'
- )
+ .addField('📥 Input', code.length > 1012 ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code)) : '```js\n' + code + '```')
.addField(
'📤 Output',
e.length > 1012