From 21f1f445660bc81a4f00fe652f3f7b5ee65e7dcd Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 23 May 2021 07:14:32 -0400 Subject: [PATCH] Only strip first beautify indent --- Xiao.js | 3 +-- commands/code/beautify.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Xiao.js b/Xiao.js index 0e3685a6..b9507004 100644 --- a/Xiao.js +++ b/Xiao.js @@ -350,8 +350,7 @@ client.on('guildMemberRemove', async member => { }); client.on('voiceStateUpdate', async (oldState, newState) => { - if (newState.channel) return; - if (!oldState.channel) return; + if (newState.channel || !oldState.channel) return; if (oldState.id === client.user.id) { const dispatcher = client.dispatchers.get(oldState.guild.id); if (!dispatcher) return; diff --git a/commands/code/beautify.js b/commands/code/beautify.js index 3b34f9c5..7d65b54e 100644 --- a/commands/code/beautify.js +++ b/commands/code/beautify.js @@ -1,6 +1,6 @@ const Command = require('../../structures/Command'); const { js_beautify: beautify } = require('js-beautify'); -const { stripIndents } = require('common-tags'); +const { stripIndent } = require('common-tags'); module.exports = class BeautifyCommand extends Command { constructor(client) { @@ -22,7 +22,7 @@ module.exports = class BeautifyCommand extends Command { } run(msg, { code }) { - return msg.reply(stripIndents` + return msg.reply(stripIndent` \`\`\`${code.lang || 'js'} ${beautify(code.code)} \`\`\`