diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-04 16:26:56 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-04 16:26:56 -0400 |
commit | 153a40fbcd314459f94d9a2b44d3466c930c4e35 (patch) | |
tree | 5c853355da693e68c393b38c0c66a1f84ef0ac89 /src/commands/dev | |
parent | cf564dbb6435886f97e2e9870363144386af368d (diff) | |
download | tanzanite-153a40fbcd314459f94d9a2b44d3466c930c4e35.tar.gz tanzanite-153a40fbcd314459f94d9a2b44d3466c930c4e35.tar.bz2 tanzanite-153a40fbcd314459f94d9a2b44d3466c930c4e35.zip |
cleaned up
Diffstat (limited to 'src/commands/dev')
-rw-r--r-- | src/commands/dev/eval.ts | 6 | ||||
-rw-r--r-- | src/commands/dev/reload.ts | 6 | ||||
-rw-r--r-- | src/commands/dev/setLevel.ts | 4 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index ebf055b..82b0e5e 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { exec } from 'child_process'; import { Constants } from 'discord-akairo'; @@ -198,7 +199,6 @@ export default class EvalCommand extends BushCommand { MessageSelectMenu, ReactionCollector, Util - // eslint-disable-next-line @typescript-eslint/no-var-requires } = require('discord.js'); // I would use import here but esbuild doesn't like that if (code[code.lang].replace(/ /g, '').includes('9+10' || '10+9')) { output = 21; @@ -259,7 +259,7 @@ export default class EvalCommand extends BushCommand { } else { embed.addField('📥 Input', await this.client.util.codeblock(inputJS, 1024, 'js')); } - embed.addField('📤 Output', await this.client.util.codeblock(typeof e === 'object' ? e?.stack : e, 1024, 'js')); + embed.addField('📤 Output', await this.client.util.codeblock(e?.stack || e, 1024, 'js')); } if (!args.silent && !message.util.isSlash) { await message.util.reply({ embeds: [embed], ephemeral: args.silent }); @@ -269,7 +269,7 @@ export default class EvalCommand extends BushCommand { try { await message.author.send({ embeds: [embed] }); if (!args.deleteMSG) await (message as BushMessage).react(this.client.util.emojis.successFull); - } catch (e) { + } catch { if (!args.deleteMSG) await (message as BushMessage).react(this.client.util.emojis.errorFull); } } diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index 4a69098..fdb669f 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -46,11 +46,7 @@ export default class ReloadCommand extends BushCommand { return message.util.send(`🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`); } catch (e) { return message.util.send( - `An error occurred while reloading:\n${await this.client.util.codeblock( - typeof e === 'object' ? e?.stack : e, - 2048 - 34, - 'js' - )}` + `An error occurred while reloading:\n${await this.client.util.codeblock(e?.stack || e, 2048 - 34, 'js')}` ); } } diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts index 2a807f8..871a9de 100644 --- a/src/commands/dev/setLevel.ts +++ b/src/commands/dev/setLevel.ts @@ -36,13 +36,13 @@ export default class SetLevelCommand extends BushCommand { ownerOnly: true, slashOptions: [ { - type: /* 'USER' */ 'USER', + type: 'USER', name: 'user', description: 'The user to change the level of', required: true }, { - type: /* 'INTEGER' */ 'INTEGER', + type: 'INTEGER', name: 'level', description: 'The level to set the user to', required: true |