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) {
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({
translate: getMessage(c.lang, "command.about.serverList.hideLocally"),
translate: getMessage(c.lang, 'command.about.serverList.hideLocally'),
color: c.colors.secondary,
with: [
{
@ -232,8 +232,8 @@ const displayServerList = function (c) {
color: c.colors.primary
}
]
});
return;
})
return
}
if (item.host.options && item.host.options.hidden && c.verify !== 2 && c.bot.id !== i) return
let message = 'command.about.serverListItem'

View file

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

View file

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

View file

@ -18,7 +18,7 @@ const settings = require('./settings.json')
const secret = require('./secret.json')
const version = require('./version.json')
const protover = require('./util/getProtocolVersion.js')
const mcd = require("minecraft-data")
const mcd = require('minecraft-data')
module.exports.bots = []
const botplug = []
@ -42,7 +42,7 @@ const loadplug = (botno) => {
})
}
let bypassWarningShown = false;
let bypassWarningShown = false
const createBot = function createBot (host, oldId) {
if (host.options.disabled) {
@ -53,13 +53,13 @@ const createBot = function createBot (host, oldId) {
port: host.port ? host.port : 25565,
version: host.version ? host.version : settings.version_mc
}
if(protover(options.version) < version.minimumMcVersion) {
if(!settings.bypassVersionRequirement){
if (protover(options.version) < version.minimumMcVersion) {
if (!settings.bypassVersionRequirement) {
console.error(`[error] ${version.botName} does not support Minecraft versions below ${version.minimumMcVersion} (${mcd.postNettyVersionsByProtocolVersion.pc[version.minimumMcVersion][0].minecraftVersion})`)
return
} 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.`)
bypassWarningShown = true;
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
}
}
if (host.options.online) {

View file

@ -92,7 +92,7 @@ module.exports = {
// Prefix tablist ads
if (!b.host.options.isVanilla) {
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',
with: [
{

View file

@ -1,7 +1,7 @@
const fs = require('fs')
const languages = {}
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 bpl = fs.readdirSync('lang')