mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 00:12:38 +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) => {
|
client.on('voiceStateUpdate', async (oldState, newState) => {
|
||||||
if (newState.channel) return;
|
if (newState.channel || !oldState.channel) return;
|
||||||
if (!oldState.channel) return;
|
|
||||||
if (oldState.id === client.user.id) {
|
if (oldState.id === client.user.id) {
|
||||||
const dispatcher = client.dispatchers.get(oldState.guild.id);
|
const dispatcher = client.dispatchers.get(oldState.guild.id);
|
||||||
if (!dispatcher) return;
|
if (!dispatcher) return;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const { js_beautify: beautify } = require('js-beautify');
|
const { js_beautify: beautify } = require('js-beautify');
|
||||||
const { stripIndents } = require('common-tags');
|
const { stripIndent } = require('common-tags');
|
||||||
|
|
||||||
module.exports = class BeautifyCommand extends Command {
|
module.exports = class BeautifyCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -22,7 +22,7 @@ module.exports = class BeautifyCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { code }) {
|
run(msg, { code }) {
|
||||||
return msg.reply(stripIndents`
|
return msg.reply(stripIndent`
|
||||||
\`\`\`${code.lang || 'js'}
|
\`\`\`${code.lang || 'js'}
|
||||||
${beautify(code.code)}
|
${beautify(code.code)}
|
||||||
\`\`\`
|
\`\`\`
|
||||||
|
|||||||
Reference in New Issue
Block a user