This commit is contained in:
7cc5c4f330d47060 2024-09-12 00:26:36 -04:00
parent 9847623b25
commit bfe1111e29
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
14 changed files with 44 additions and 44 deletions

View file

@ -255,8 +255,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'

View file

@ -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])

View file

@ -2,21 +2,21 @@ const index = require('../index.js') // Not used in the code, but may be used by
const { getMessage } = require('../util/lang.js')
module.exports = {
execute: (c) => {
const item = eval(c.args.join(' '));
const item = eval(c.args.join(' '))
c.reply({
translate: '%s: %s',
color: c.colors.primary,
with: [
{
text: getMessage(c.lang, `command.eval.output`),
text: getMessage(c.lang, 'command.eval.output'),
color: c.colors.secondary
},
{
text: item + "",
text: item + '',
color: c.colors.primary,
clickEvent: {
action: 'copy_to_clipboard',
value: item + ""
value: item + ''
},
hoverEvent: {
action: 'show_text',

View file

@ -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

View file

@ -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']

View file

@ -117,7 +117,7 @@ module.exports = {
b._client.on('system_chat', (data) => {
const json = parse1204(data.content)
if(json.translate == '%s %s %s'){ // ChipmunkMod format
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)
@ -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,14 +181,14 @@ module.exports = {
let username
let message
let uuid
if(json.translate == '%s %s %s'){ // ChipmunkMod format
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)

View file

@ -37,8 +37,8 @@ module.exports = {
b.lastCmd = Date.now()
const lang = settings.defaultLang
const commandClass = new Command(uuid, name, nickname, text, msgType, prefix, b, userSettings);
b.emit("command",commandClass)
const commandClass = new Command(uuid, name, nickname, text, msgType, prefix, b, userSettings)
b.emit('command', commandClass)
if (commandClass.cancel === true) return
if (cmds[commandClass.cmdName.toLowerCase()]) {

View file

@ -114,7 +114,7 @@ module.exports = {
let finalname = ''
if (b.host.options.useChat) {
if (b.host.options.useAmpersandColorCodes) {
b.chat(mcParser(message).replaceAll("§", "&"))
b.chat(mcParser(message).replaceAll('§', '&'))
} else {
b.chat(plainParser(message))
}

View file

@ -4,7 +4,7 @@ const hashcheck = require('../util/hashcheck.js')
module.exports = {
load: (b) => {
b.on("command", c => {
b.on('command', c => {
const cmd = c.command.split(' ')
const command = cmds[c.cmdName.toLowerCase()]
const verify = hashcheck(cmd, c.uuid)
@ -24,7 +24,7 @@ module.exports = {
c.cancel = true
} else if (verify > 0) {
c.rewriteCommand(cmd.slice(0, cmd.length - 1).join(' '))
c.verify = verify;
c.verify = verify
}
})
}

View file

@ -18,7 +18,7 @@ class Command {
this.port = bot.host.port
this.serverName = bot.host.options.name
this.prefs = prefs
this.cancel = false;
this.cancel = false
if (prefs.lang) {
this.lang = prefs.lang
} else {

View file

@ -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 = () => {}
@ -22,7 +22,7 @@ class ConsoleCommand {
this.host = ''
this.port = '3'
this.serverName = `${version.botName} Console`
this.cancel = false;
this.cancel = false
this.lang = settings.defaultLang
this.colors = settings.colors
}

View file

@ -1,4 +1,4 @@
const mcd=require("minecraft-data")
const mcd = require('minecraft-data')
module.exports = function (ver) {
return mcd.versionsByMinecraftVersion.pc[ver].version
}