This commit is contained in:
7cc5c4f330d47060 2024-10-12 01:44:33 -04:00
parent f9e076fe91
commit 9e48e9b6ea
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
6 changed files with 17 additions and 17 deletions

View file

@ -222,9 +222,9 @@ const aboutServer = function (c) {
const displayServerList = function (c) { const displayServerList = function (c) {
index.bots.forEach((item, i) => { index.bots.forEach((item, i) => {
if(c.bot.id == i && c.bot.host.options.hideLocally){ if (c.bot.id === i && c.bot.host.options.hideLocally) {
c.reply({ c.reply({
translate: getMessage(c.lang, "command.about.serverList.hideLocally"), translate: getMessage(c.lang, 'command.about.serverList.hideLocally'),
color: c.colors.secondary, color: c.colors.secondary,
with: [ with: [
{ {
@ -232,8 +232,8 @@ const displayServerList = function (c) {
color: c.colors.primary color: c.colors.primary
} }
] ]
}); })
return; return
} }
if (item.host.options && item.host.options.hidden && c.verify !== 2 && c.bot.id !== i) return if (item.host.options && item.host.options.hidden && c.verify !== 2 && c.bot.id !== i) return
let message = 'command.about.serverListItem' let message = 'command.about.serverListItem'

View file

@ -3,7 +3,7 @@ const { getMessage } = require('../util/lang.js')
module.exports = { module.exports = {
execute: (c) => { execute: (c) => {
const item = eval(c.args.join(' ')) const item = eval(c.args.join(' '))
if(c.type == "console"){ if (c.type === 'console') {
console.log(item) console.log(item)
} else { } else {
c.reply({ c.reply({

View file

@ -2,10 +2,10 @@ const settings = require('../settings.json')
const version = require('../version.json') const version = require('../version.json')
module.exports = { module.exports = {
execute: (c) => { execute: (c) => {
if (c.verify < 1){ if (c.verify < 1) {
c.bot.tellraw("@a",{ c.bot.tellraw('@a', {
translate: "%s %s: %s", translate: '%s %s: %s',
color: "white", color: 'white',
with: [ with: [
{ {
translate: '[%s]', translate: '[%s]',

View file

@ -18,7 +18,7 @@ const settings = require('./settings.json')
const secret = require('./secret.json') const secret = require('./secret.json')
const version = require('./version.json') const version = require('./version.json')
const protover = require('./util/getProtocolVersion.js') const protover = require('./util/getProtocolVersion.js')
const mcd = require("minecraft-data") const mcd = require('minecraft-data')
module.exports.bots = [] module.exports.bots = []
const botplug = [] const botplug = []
@ -42,7 +42,7 @@ const loadplug = (botno) => {
}) })
} }
let bypassWarningShown = false; let bypassWarningShown = false
const createBot = function createBot (host, oldId) { const createBot = function createBot (host, oldId) {
if (host.options.disabled) { if (host.options.disabled) {
@ -53,13 +53,13 @@ const createBot = function createBot (host, oldId) {
port: host.port ? host.port : 25565, port: host.port ? host.port : 25565,
version: host.version ? host.version : settings.version_mc version: host.version ? host.version : settings.version_mc
} }
if(protover(options.version) < version.minimumMcVersion) { if (protover(options.version) < version.minimumMcVersion) {
if(!settings.bypassVersionRequirement){ if (!settings.bypassVersionRequirement) {
console.error(`[error] ${version.botName} does not support Minecraft versions below ${version.minimumMcVersion} (${mcd.postNettyVersionsByProtocolVersion.pc[version.minimumMcVersion][0].minecraftVersion})`) console.error(`[error] ${version.botName} does not support Minecraft versions below ${version.minimumMcVersion} (${mcd.postNettyVersionsByProtocolVersion.pc[version.minimumMcVersion][0].minecraftVersion})`)
return return
} else { } else {
if(!bypassWarningShown) console.warn(`[warning] You have disabled the version requirement, allowing the bot to join to servers with old Minecraft versions. These versions are unsupported and may break at any time. Any issues on such versions will not be fixed.`) if (!bypassWarningShown) console.warn('[warning] You have disabled the version requirement, allowing the bot to join to servers with old Minecraft versions. These versions are unsupported and may break at any time. Any issues on such versions will not be fixed.')
bypassWarningShown = true; bypassWarningShown = true
} }
} }
if (host.options.online) { if (host.options.online) {

View file

@ -92,7 +92,7 @@ module.exports = {
// Prefix tablist ads // Prefix tablist ads
if (!b.host.options.isVanilla) { if (!b.host.options.isVanilla) {
b.adPrefix = { b.adPrefix = {
translate: '[%s] %s', //Since the bot aims to have an invisible name, the ad prefix should contain information about the bot. translate: '[%s] %s', // Since the bot aims to have an invisible name, the ad prefix should contain information about the bot.
color: 'white', color: 'white',
with: [ with: [
{ {

View file

@ -1,7 +1,7 @@
const fs = require('fs') const fs = require('fs')
const languages = {} const languages = {}
const settings = require('../settings.json') const settings = require('../settings.json')
const fallbackLocale = settings.fallbackLocale ? settings.fallbackLocale : "en-US"; const fallbackLocale = settings.fallbackLocale ? settings.fallbackLocale : 'en-US'
const loadplug = (botno) => { const loadplug = (botno) => {
const bpl = fs.readdirSync('lang') const bpl = fs.readdirSync('lang')