diff options
Diffstat (limited to 'src/commands/dev')
-rw-r--r-- | src/commands/dev/eval.ts | 32 | ||||
-rw-r--r-- | src/commands/dev/setLevel.ts | 13 |
2 files changed, 11 insertions, 34 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) { diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts index d1701c5..e57e2f8 100644 --- a/src/commands/dev/setLevel.ts +++ b/src/commands/dev/setLevel.ts @@ -23,8 +23,7 @@ export default class SetLevelCommand extends BushCommand { type: 'user', prompt: { start: 'What user would you like to change the level of?', - retry: - 'Invalid user. What user would you like to change the level of?' + retry: 'Invalid user. What user would you like to change the level of?' } }, { @@ -68,10 +67,7 @@ export default class SetLevelCommand extends BushCommand { return `Successfully set level of <@${user.id}> to \`${level}\` (\`${levelEntry.xp}\` XP)`; } - async exec( - message: Message, - { user, level }: { user: User; level: number } - ): Promise<void> { + async exec(message: Message, { user, level }: { user: User; level: number }): Promise<void> { await message.util.send(await this.setLevel(user, level), { allowedMentions: AllowedMentions.none() }); @@ -79,10 +75,7 @@ export default class SetLevelCommand extends BushCommand { async execSlash( message: CommandInteraction, - { - user, - level - }: { user: SlashCommandOption<void>; level: SlashCommandOption<number> } + { user, level }: { user: SlashCommandOption<void>; level: SlashCommandOption<number> } ): Promise<void> { await message.reply(await this.setLevel(user.user, level.value), { allowedMentions: AllowedMentions.none() |