Lint
This commit is contained in:
parent
f9e076fe91
commit
9e48e9b6ea
6 changed files with 17 additions and 17 deletions
|
@ -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'
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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]',
|
||||
|
|
12
index.js
12
index.js
|
@ -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) {
|
||||
|
|
|
@ -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: [
|
||||
{
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue