mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Only strip first beautify indent
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)}
|
||||
\`\`\`
|
||||
|
||||
Reference in New Issue
Block a user