mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
Fix
This commit is contained in:
@@ -21,7 +21,7 @@ module.exports = class BeautifyCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg, { code }) {
|
run(msg, { code }) {
|
||||||
return msg.reply(stripIndents`
|
return msg.reply(stripIndents`
|
||||||
\`\`\`${code.lang || 'js'}
|
\`\`\`${code.lang || 'js'}
|
||||||
${beautify(code.code)}
|
${beautify(code.code)}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ module.exports = class LintCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg, { code }) {
|
run(msg, { code }) {
|
||||||
if (!code.lang || ['js', 'javascript'].includes(code.lang)) {
|
if (!code.lang || ['js', 'javascript'].includes(code.lang)) {
|
||||||
const errors = linter.verify(code.code, defaultConfig);
|
const errors = linter.verify(code.code, defaultConfig);
|
||||||
if (!errors.length) return msg.reply(goodMessages[Math.floor(Math.random() * goodMessages.length)]);
|
if (!errors.length) return msg.reply(goodMessages[Math.floor(Math.random() * goodMessages.length)]);
|
||||||
|
|||||||
Reference in New Issue
Block a user