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)} \`\`\`