From a85269ecce3b739c0f791a2d91a9ef84172487f7 Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Thu, 12 Sep 2024 00:18:41 -0400 Subject: [PATCH] Lint --- commands/about.js | 4 ++-- commands/cloop.js | 4 ++-- commands/help.js | 4 ++-- commands/settings.js | 4 ++-- plugins/!chat.js | 22 +++++++++++----------- util/ConsoleCommand.js | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/commands/about.js b/commands/about.js index 5ff2c23..6ed9283 100644 --- a/commands/about.js +++ b/commands/about.js @@ -239,8 +239,8 @@ const displayServerList = function (c) { module.exports = { execute: function (c) { - let subcmd; - if(c.args.length>=1) subcmd = c.args[0].toLowerCase(); + let subcmd + if (c.args.length >= 1) subcmd = c.args[0].toLowerCase() if (subcmd === 'servers') subcmd = 'serverlist' if (c.cmdName.toLowerCase() === 'serverinfo' || c.cmdName.toLowerCase() === 'specs') subcmd = 'server' if (c.cmdName.toLowerCase() === 'serverlist' || c.cmdName.toLowerCase() === 'servers') subcmd = 'serverlist' diff --git a/commands/cloop.js b/commands/cloop.js index ed0bbe7..78f2421 100644 --- a/commands/cloop.js +++ b/commands/cloop.js @@ -1,8 +1,8 @@ const { getMessage } = require('../util/lang.js') module.exports = { execute: (c) => { - let subcmd; - if(c.args.length>=1) subcmd = c.args.splice(0, 1)[0].toLowerCase(); + let subcmd + if (c.args.length >= 1) subcmd = c.args.splice(0, 1)[0].toLowerCase() switch (subcmd) { case 'add': { const rate = +(c.args.splice(0, 1)[0]) diff --git a/commands/help.js b/commands/help.js index ce56004..474a3fa 100644 --- a/commands/help.js +++ b/commands/help.js @@ -65,8 +65,8 @@ const printHelp = (c) => { } const printCmdHelp = (c) => { - let cmd; - if(c.args.length>=1) cmd = c.args[0].toLowerCase(); + let cmd + if (c.args.length >= 1) cmd = c.args[0].toLowerCase() if (!cmds[cmd] || (cmds[cmd].hidden && c.type !== 'console')) { c.reply({ text: getMessage(c.lang, 'command.help.noCommand') }) return diff --git a/commands/settings.js b/commands/settings.js index 54a1e3a..09ed03c 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -17,8 +17,8 @@ module.exports = { }) return } - let subcmd; - if(c.args.length>=1) subcmd = c.args.splice(0, 1)[0].toLowerCase(); + let subcmd + if (c.args.length >= 1) subcmd = c.args.splice(0, 1)[0].toLowerCase() switch (subcmd) { case 'set':{ const allowedKeys = ['colorPrimary', 'colorSecondary', 'lang'] diff --git a/plugins/!chat.js b/plugins/!chat.js index 087580e..f844417 100755 --- a/plugins/!chat.js +++ b/plugins/!chat.js @@ -117,8 +117,8 @@ module.exports = { b._client.on('system_chat', (data) => { const json = parse1204(data.content) - if(json.translate == '%s %s › %s'){ // ChipmunkMod format - if(json.with && json.with[1] && json.with[2]){ + if (json.translate === '%s %s › %s') { // ChipmunkMod format + if (json.with && json.with[1] && json.with[2]) { const username = parsePlain(json.with[1]) const uuid = b.findUUID(username) const nickname = b.findDisplayName(uuid) @@ -135,13 +135,13 @@ module.exports = { b.emit('chat', { json, type: 'system', - uuid: "00000000-0000-0000-0000-000000000000", - message: "", - nickname: "", - username: "" + uuid: '00000000-0000-0000-0000-000000000000', + message: '', + nickname: '', + username: '' }) } - } else if(json.extra && json.extra[4] && json.extra[3] && json.extra[5] && json.extra[4].text == ' » '){ // ChipmunkMod format - m_c_player + } else if (json.extra && json.extra[4] && json.extra[3] && json.extra[5] && json.extra[4].text === ' » ') { // ChipmunkMod format - m_c_player const username = parsePlain(json.extra[3]) const uuid = b.findUUID(username) const nickname = b.findDisplayName(uuid) @@ -181,19 +181,19 @@ module.exports = { let username let message let uuid - if(json.translate == '%s %s › %s'){ // ChipmunkMod format - if(json.with && json.with[1] && json.with[2]){ + if (json.translate === '%s %s › %s') { // ChipmunkMod format + if (json.with && json.with[1] && json.with[2]) { username = parsePlain(json.with[1]) uuid = b.findUUID(username) nickname = b.findDisplayName(uuid) message = parsePlain(json.with[2].extra) } - } else if(json.extra && json.extra[4] && json.extra[3] && json.extra[5] && json.extra[4].text == ' » '){ // ChipmunkMod format - m_c_player + } else if (json.extra && json.extra[4] && json.extra[3] && json.extra[5] && json.extra[4].text === ' » ') { // ChipmunkMod format - m_c_player username = parsePlain(json.extra[3]) uuid = b.findUUID(username) nickname = b.findDisplayName(uuid) message = parsePlain(json.extra[5]) - } else if (b.host.options.isVanilla && json.translate === 'chat.type.text') { // Servers without Extras chat + } else if (b.host.options.isVanilla && json.translate === 'chat.type.text') { // Servers without Extras chat if (json.with && json.with.length >= 2) { message = parsePlain(json.with[1]) username = parsePlain(json.with[0]) diff --git a/util/ConsoleCommand.js b/util/ConsoleCommand.js index fc77bbf..c17cdbc 100644 --- a/util/ConsoleCommand.js +++ b/util/ConsoleCommand.js @@ -1,7 +1,7 @@ const index = require('../index.js') const parse = require('../util/chatparse_console.js') const settings = require('../settings.json') -const version = require("../version.json") +const version = require('../version.json') class ConsoleCommand { constructor (cmd, index2) { this.send = () => {}