Lint
This commit is contained in:
parent
831ed85c00
commit
314cfc9f85
10 changed files with 30 additions and 30 deletions
|
@ -112,7 +112,7 @@ const aboutServer = function (c) {
|
||||||
text: thisItem,
|
text: thisItem,
|
||||||
color: c.colors.primary,
|
color: c.colors.primary,
|
||||||
clickEvent: {
|
clickEvent: {
|
||||||
action: "copy_to_clipboard",
|
action: 'copy_to_clipboard',
|
||||||
value: thisItem
|
value: thisItem
|
||||||
},
|
},
|
||||||
hoverEvent: {
|
hoverEvent: {
|
||||||
|
@ -201,10 +201,10 @@ const aboutServer = function (c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const displayServerList = function (c) {
|
const displayServerList = function (c) {
|
||||||
index.bot.forEach((item, i)=>{
|
index.bot.forEach((item, i) => {
|
||||||
if (item.host.options && item.host.options.hidden && c.verify !== 3 && c.bot.id !== i) return
|
if (item.host.options && item.host.options.hidden && c.verify !== 3 && c.bot.id !== i) return
|
||||||
let message = 'command.about.serverListItem';
|
let message = 'command.about.serverListItem'
|
||||||
if(c.bot.id == i) message = 'command.about.serverListItem.thisServer'
|
if (c.bot.id == i) message = 'command.about.serverListItem.thisServer'
|
||||||
c.reply({
|
c.reply({
|
||||||
translate: getMessage(c.lang, message),
|
translate: getMessage(c.lang, message),
|
||||||
color: c.colors.secondary,
|
color: c.colors.secondary,
|
||||||
|
@ -217,7 +217,7 @@ const displayServerList = function (c) {
|
||||||
text: `${item.host.host}:${item.host.port}`,
|
text: `${item.host.host}:${item.host.port}`,
|
||||||
color: c.colors.primary,
|
color: c.colors.primary,
|
||||||
clickEvent: {
|
clickEvent: {
|
||||||
action: "copy_to_clipboard",
|
action: 'copy_to_clipboard',
|
||||||
value: `${item.host.host}:${item.host.port}`
|
value: `${item.host.host}:${item.host.port}`
|
||||||
},
|
},
|
||||||
hoverEvent: {
|
hoverEvent: {
|
||||||
|
@ -240,9 +240,9 @@ const displayServerList = function (c) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
execute: function (c) {
|
execute: function (c) {
|
||||||
let subcmd = c.args[0]
|
let subcmd = c.args[0]
|
||||||
if(subcmd === "servers") subcmd = "serverlist"
|
if (subcmd === 'servers') subcmd = 'serverlist'
|
||||||
if(c.cmdName === "serverinfo") subcmd = "server"
|
if (c.cmdName === 'serverinfo') subcmd = 'server'
|
||||||
if(c.cmdName === "serverlist" || c.cmdName === "servers") subcmd = "serverlist"
|
if (c.cmdName === 'serverlist' || c.cmdName === 'servers') subcmd = 'serverlist'
|
||||||
if (subcmd === 'server') {
|
if (subcmd === 'server') {
|
||||||
aboutServer(c)
|
aboutServer(c)
|
||||||
} else if (subcmd === 'serverlist') {
|
} else if (subcmd === 'serverlist') {
|
||||||
|
|
|
@ -44,7 +44,7 @@ module.exports = {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 'list':
|
case 'list':
|
||||||
c.bot.cloops.forEach((item, i)=>{
|
c.bot.cloops.forEach((item, i) => {
|
||||||
c.reply({
|
c.reply({
|
||||||
translate: getMessage(c.lang, 'command.cloop.list'),
|
translate: getMessage(c.lang, 'command.cloop.list'),
|
||||||
color: c.colors.secondary,
|
color: c.colors.secondary,
|
||||||
|
|
|
@ -4,9 +4,9 @@ module.exports = {
|
||||||
execute: (c) => {
|
execute: (c) => {
|
||||||
let host = c.host
|
let host = c.host
|
||||||
let port = c.port
|
let port = c.port
|
||||||
if(c.bot.host.options && c.bot.host.options.hidden){
|
if (c.bot.host.options && c.bot.host.options.hidden) {
|
||||||
host = "localhost" // Makes hidden servers appear as localhost
|
host = 'localhost' // Makes hidden servers appear as localhost
|
||||||
port = "25565"
|
port = '25565'
|
||||||
}
|
}
|
||||||
const json = {
|
const json = {
|
||||||
translate: '[%s] %s: %s',
|
translate: '[%s] %s: %s',
|
||||||
|
@ -14,12 +14,12 @@ module.exports = {
|
||||||
{
|
{
|
||||||
text: c.serverName,
|
text: c.serverName,
|
||||||
hoverEvent: {
|
hoverEvent: {
|
||||||
action: "show_text",
|
action: 'show_text',
|
||||||
value: {
|
value: {
|
||||||
translate: '%s: %s:%s',
|
translate: '%s: %s:%s',
|
||||||
with: [
|
with: [
|
||||||
{
|
{
|
||||||
text: getMessage(c.lang, "command.netmsg.serverAddress"),
|
text: getMessage(c.lang, 'command.netmsg.serverAddress'),
|
||||||
color: c.colors.primary
|
color: c.colors.primary
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ module.exports = {
|
||||||
color: 'white'
|
color: 'white'
|
||||||
}
|
}
|
||||||
bot.forEach(item => {
|
bot.forEach(item => {
|
||||||
if(item.host.options && item.host.options.netmsgIncomingDisabled && c.type !== "console") return
|
if (item.host.options && item.host.options.netmsgIncomingDisabled && c.type !== 'console') return
|
||||||
item.tellraw('@a', json)
|
item.tellraw('@a', json)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ const { languages, getMessage } = require('../util/lang.js')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
execute: (c) => {
|
execute: (c) => {
|
||||||
if(c.type == "console"){
|
if (c.type == 'console') {
|
||||||
c.reply({
|
c.reply({
|
||||||
text: getMessage(c.lang, 'command.settings.disabled.console'),
|
text: getMessage(c.lang, 'command.settings.disabled.console'),
|
||||||
color: c.colors.secondary
|
color: c.colors.secondary
|
||||||
|
|
|
@ -14,7 +14,7 @@ module.exports = {
|
||||||
text: item,
|
text: item,
|
||||||
color: c.colors.primary,
|
color: c.colors.primary,
|
||||||
clickEvent: {
|
clickEvent: {
|
||||||
action: "copy_to_clipboard",
|
action: 'copy_to_clipboard',
|
||||||
value: item
|
value: item
|
||||||
},
|
},
|
||||||
hoverEvent: {
|
hoverEvent: {
|
||||||
|
|
10
index.js
10
index.js
|
@ -1,14 +1,14 @@
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
|
||||||
if (!fs.readdirSync('.').includes('settings.json')) {
|
if (!fs.readdirSync('.').includes('settings.json')) {
|
||||||
console.log("Settings file is missing, using defaults.")
|
console.log('Settings file is missing, using defaults.')
|
||||||
fs.copyFileSync("settings_example.json", "settings.json")
|
fs.copyFileSync('settings_example.json', 'settings.json')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fs.readdirSync('.').includes('secret.json')) {
|
if (!fs.readdirSync('.').includes('secret.json')) {
|
||||||
console.log("Secrets file is missing, using defaults.")
|
console.log('Secrets file is missing, using defaults.')
|
||||||
fs.copyFileSync("secret_example.json", "secret.json")
|
fs.copyFileSync('secret_example.json', 'secret.json')
|
||||||
console.log("Please change the hashing keys in the secrets file.")
|
console.log('Please change the hashing keys in the secrets file.')
|
||||||
}
|
}
|
||||||
|
|
||||||
const m = require('minecraft-protocol')
|
const m = require('minecraft-protocol')
|
||||||
|
|
|
@ -18,7 +18,7 @@ module.exports = {
|
||||||
load: (b) => {
|
load: (b) => {
|
||||||
b.prefix = settings.prefix
|
b.prefix = settings.prefix
|
||||||
b.lastCmd = 0
|
b.lastCmd = 0
|
||||||
b.on("chat",(data)=>{
|
b.on('chat', (data) => {
|
||||||
const fullCommand = data.message
|
const fullCommand = data.message
|
||||||
for (const prefix of b.prefix) {
|
for (const prefix of b.prefix) {
|
||||||
if (fullCommand.startsWith(prefix)) {
|
if (fullCommand.startsWith(prefix)) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ const parse = function (_data, l = 0, resetColor = consoleColors.reset) {
|
||||||
if (lang[trans] !== undefined) {
|
if (lang[trans] !== undefined) {
|
||||||
trans = lang[trans].replace(/%%/g, '\ue123')
|
trans = lang[trans].replace(/%%/g, '\ue123')
|
||||||
}
|
}
|
||||||
if(data.with){
|
if (data.with) {
|
||||||
data.with.forEach((item, i) => {
|
data.with.forEach((item, i) => {
|
||||||
const j2 = parse(item, l + 1, data.color ? processColor(data.color, resetColor) : resetColor)
|
const j2 = parse(item, l + 1, data.color ? processColor(data.color, resetColor) : resetColor)
|
||||||
trans = trans.replace(/%s/, j2.replaceAll('%s', '\ud900\ud804').replaceAll('$s', '\ud900\ud805'))
|
trans = trans.replace(/%s/, j2.replaceAll('%s', '\ud900\ud804').replaceAll('$s', '\ud900\ud805'))
|
||||||
|
|
|
@ -21,8 +21,8 @@ const getMessage = function (l, msg, with2) {
|
||||||
} else if (languages['en-US'] && languages['en-US'][message] !== undefined) {
|
} else if (languages['en-US'] && languages['en-US'][message] !== undefined) {
|
||||||
message = languages['en-US'][message].replace(/%%/g, '\ue123')
|
message = languages['en-US'][message].replace(/%%/g, '\ue123')
|
||||||
}
|
}
|
||||||
if (with2){
|
if (with2) {
|
||||||
with2.forEach((withItem, i)=>{
|
with2.forEach((withItem, i) => {
|
||||||
message = message.replace(/%s/, withItem.replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
|
message = message.replace(/%s/, withItem.replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
|
||||||
message = message.replaceAll(`%${+i + 1}$s`, withItem.replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
|
message = message.replaceAll(`%${+i + 1}$s`, withItem.replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
|
||||||
})
|
})
|
||||||
|
|
|
@ -32,12 +32,12 @@ const rsg = function (count) {
|
||||||
}
|
}
|
||||||
const rsgLegal = function (count) {
|
const rsgLegal = function (count) {
|
||||||
let output = ''
|
let output = ''
|
||||||
if(Math.random()>0.5){
|
if (Math.random() > 0.5) {
|
||||||
output += "uwu_"
|
output += 'uwu_'
|
||||||
} else {
|
} else {
|
||||||
output += "owo_"
|
output += 'owo_'
|
||||||
}
|
}
|
||||||
output += crypto.randomBytes(count).toString("hex")
|
output += crypto.randomBytes(count).toString('hex')
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
module.exports = function (legal) {
|
module.exports = function (legal) {
|
||||||
|
|
Loading…
Reference in a new issue