Compare commits
7 commits
e87b2bbe2b
...
64590be691
Author | SHA1 | Date | |
---|---|---|---|
64590be691 | |||
590b749bcb | |||
d679c90fc8 | |||
c33664382a | |||
e7ddcd4516 | |||
03f725a888 | |||
1eef37ae86 |
43 changed files with 628 additions and 545 deletions
|
@ -1,4 +1,4 @@
|
|||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||
import parsePlain from '../util/chatparse_plain.js'
|
||||
|
||||
const priority = 0
|
||||
const parse = (data, b) => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||
import parsePlain from '../util/chatparse_plain.js'
|
||||
|
||||
const priority = 0
|
||||
const parse = (data, b) => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||
import parsePlain from '../util/chatparse_plain.js'
|
||||
|
||||
const priority = 1
|
||||
const parse = (data, b) => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||
import parsePlain from '../util/chatparse_plain.js'
|
||||
|
||||
const priority = 2
|
||||
const parse = (data, b) => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||
import parsePlain from '../util/chatparse_plain.js'
|
||||
|
||||
const priority = 1
|
||||
const parse = (data, b) => {
|
||||
|
|
|
@ -2,11 +2,10 @@ import os from 'node:os'
|
|||
import { execSync } from 'child_process'
|
||||
import { getMessage, formatTime } from '../util/lang.js'
|
||||
import memoryconvert from '../util/memoryconvert.js'
|
||||
import { readdirSync, readFileSync } from "node:fs"
|
||||
import { default as botVersion } from "../util/version.js"
|
||||
import { default as version } from "../version.json" with { type: "json" }
|
||||
import { bots } from "../index.js"
|
||||
|
||||
import { readdirSync, readFileSync } from 'node:fs'
|
||||
import botVersion from '../util/version.js'
|
||||
import version from '../version.js'
|
||||
import { bots } from '../index.js'
|
||||
|
||||
const aboutBot = function (c) {
|
||||
c.reply({
|
||||
|
|
6
commands/cb.js
Executable file
6
commands/cb.js
Executable file
|
@ -0,0 +1,6 @@
|
|||
const execute = (c) => {
|
||||
c.bot.ccq.push(c.args.join(' '))
|
||||
}
|
||||
const consoleIndex = true
|
||||
const aliases = ['commandblock', 'cmdblock']
|
||||
export { execute, consoleIndex, aliases }
|
|
@ -1,13 +1,13 @@
|
|||
import * as index from "../index.js" // Not used in the code, but may be used by users of the command
|
||||
import * as index from '../index.js' // Not used in the code, but may be used by users of the command
|
||||
import { getMessage } from '../util/lang.js'
|
||||
|
||||
const execute = (c) => {
|
||||
if(c.verify != 2){
|
||||
if (c.verify !== 2) {
|
||||
c.reply({
|
||||
text: getMessage(c.lang, "command.disallowed.perms.short")
|
||||
text: getMessage(c.lang, 'command.disallowed.perms.short')
|
||||
})
|
||||
c.reply({
|
||||
text: getMessage(c.lang, "command.disabled.nonConsole")
|
||||
text: getMessage(c.lang, 'command.disabled.nonConsole')
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -48,4 +48,3 @@ const execute = (c) => {
|
|||
}
|
||||
const level = 2
|
||||
export { execute, level }
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import cmds from "../util/commands.js"
|
||||
import cmds from '../util/commands.js'
|
||||
import { getMessage } from '../util/lang.js'
|
||||
|
||||
const sortHelp = function sortHelp (c1, c2) {
|
||||
|
@ -171,12 +171,12 @@ const printCmdHelp = (c) => {
|
|||
}
|
||||
]
|
||||
})
|
||||
if(cmds[cmd].aliases){
|
||||
const aliasList = [];
|
||||
for(const item of cmds[cmd].aliases){
|
||||
if(aliasList.length>0){
|
||||
if (cmds[cmd].aliases) {
|
||||
const aliasList = []
|
||||
for (const item of cmds[cmd].aliases) {
|
||||
if (aliasList.length > 0) {
|
||||
aliasList.push({
|
||||
text: ", ",
|
||||
text: ', ',
|
||||
color: c.colors.secondary
|
||||
})
|
||||
}
|
||||
|
@ -224,7 +224,6 @@ const printCmdHelp = (c) => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
const execute = (c) => {
|
||||
if (c.args.length > 0) {
|
||||
printCmdHelp(c)
|
||||
|
@ -236,4 +235,3 @@ const aliases = [
|
|||
'heko' // Parker2991 request
|
||||
]
|
||||
export { execute, aliases }
|
||||
|
||||
|
|
8
commands/logoff.js
Executable file
8
commands/logoff.js
Executable file
|
@ -0,0 +1,8 @@
|
|||
const execute= (c) => {
|
||||
c.reply("Command has been disabled")
|
||||
//c.bot._client.end()
|
||||
}
|
||||
const consoleIndex= true
|
||||
const level= 2
|
||||
|
||||
export { execute, consoleIndex, level }
|
57
commands/netmsg.js
Executable file
57
commands/netmsg.js
Executable file
|
@ -0,0 +1,57 @@
|
|||
import { bots } from '../index.js'
|
||||
import { getMessage } from '../util/lang.js'
|
||||
|
||||
const execute = (c) => {
|
||||
let host = c.host
|
||||
let port = c.port
|
||||
if (c.bot.host.options && c.bot.host.options.hidden) {
|
||||
host = 'localhost' // Makes hidden servers appear as localhost
|
||||
port = '25565'
|
||||
} else if (c.bot.host.options && c.bot.host.options.displayAsIPv6) {
|
||||
host = `[${host}]`
|
||||
}
|
||||
const json = {
|
||||
translate: '[%s] %s: %s',
|
||||
with: [
|
||||
{
|
||||
text: c.serverName,
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
value: {
|
||||
translate: '%s: %s:%s',
|
||||
with: [
|
||||
{
|
||||
text: getMessage(c.lang, 'command.netmsg.serverAddress'),
|
||||
color: c.colors.primary
|
||||
},
|
||||
{
|
||||
text: host,
|
||||
color: c.colors.primary
|
||||
},
|
||||
{
|
||||
text: port + '',
|
||||
color: c.colors.primary
|
||||
}
|
||||
],
|
||||
color: c.colors.secondary
|
||||
}
|
||||
},
|
||||
color: c.colors.primary
|
||||
},
|
||||
{
|
||||
text: c.username,
|
||||
color: c.colors.primary
|
||||
},
|
||||
{
|
||||
text: c.args.join(' ').slice(0, 512)
|
||||
}
|
||||
],
|
||||
color: 'white'
|
||||
}
|
||||
bots.forEach(item => {
|
||||
if (item.host.options && item.host.options.netmsgIncomingDisabled && c.type !== 'console') return
|
||||
item.tellraw('@a', json)
|
||||
})
|
||||
}
|
||||
|
||||
export { execute }
|
7
commands/refill.js
Executable file
7
commands/refill.js
Executable file
|
@ -0,0 +1,7 @@
|
|||
const execute= (c) => {
|
||||
c.bot.chat(c.bot.refillCoreCmd)
|
||||
}
|
||||
const consoleIndex= true
|
||||
const aliases = ['refillcore', 'rc']
|
||||
|
||||
export { execute, consoleIndex, aliases }
|
8
commands/restart.js
Executable file
8
commands/restart.js
Executable file
|
@ -0,0 +1,8 @@
|
|||
const execute= (c) => {
|
||||
c.reply("Command has been disabled")
|
||||
//process.exit(0)
|
||||
}
|
||||
const aliases = ['reboot']
|
||||
const level= 2
|
||||
|
||||
export { execute, aliases, level }
|
|
@ -1,5 +1,5 @@
|
|||
import { default as settings } from '../settings.js'
|
||||
import { default as version } from "../version.json" with { type: "json" }
|
||||
import settings from '../settings.js'
|
||||
import version from '../version.js'
|
||||
const execute = (c) => {
|
||||
if (c.verify < 1) {
|
||||
c.bot.tellraw('@a', {
|
||||
|
|
8
commands/stop.js
Executable file
8
commands/stop.js
Executable file
|
@ -0,0 +1,8 @@
|
|||
const execute= (c) => {
|
||||
c.reply("Command has been disabled")
|
||||
//process.exit(1)
|
||||
}
|
||||
const aliases = ['exit']
|
||||
const level= 2
|
||||
|
||||
export { execute, aliases, level }
|
|
@ -34,11 +34,11 @@ const execute = (c) => {
|
|||
c.reply(reply('uuid', c.uuid))
|
||||
c.reply(reply('username', c.username))
|
||||
c.reply(reply('nickname', c.nickname))
|
||||
c.reply(reply('command', c.command.slice(0,1024)))
|
||||
c.reply(reply('command', c.command.slice(0, 1024)))
|
||||
c.reply(reply('msgType', c.msgType))
|
||||
c.reply(reply('msgSubtype', c.msgSubtype))
|
||||
c.reply(reply('prefix', c.prefix))
|
||||
c.reply(reply('args', c.args.join(', ').slice(0,1024)))
|
||||
c.reply(reply('args', c.args.join(', ').slice(0, 1024)))
|
||||
c.reply(reply('verify', c.verify.toString()))
|
||||
c.reply(reply('host', c.host))
|
||||
c.reply(reply('port', c.port.toString()))
|
||||
|
|
16
index.js
16
index.js
|
@ -1,20 +1,20 @@
|
|||
import { createClient } from "minecraft-protocol";
|
||||
import { default as settings } from './settings.js'
|
||||
import { createClient } from 'minecraft-protocol'
|
||||
import settings from './settings.js'
|
||||
import generateUser from './util/usergen.js'
|
||||
import EventEmitter from 'node:events'
|
||||
import { readdirSync } from "node:fs";
|
||||
import { readdirSync } from 'node:fs'
|
||||
|
||||
const bots = [];
|
||||
const bots = []
|
||||
|
||||
const plugins = [];
|
||||
const plugins = []
|
||||
const bpl = readdirSync('plugins')
|
||||
for (const plugin of bpl) {
|
||||
if (!plugin.endsWith('.js')) {
|
||||
continue
|
||||
}
|
||||
try {
|
||||
import(`./plugins/${plugin}`).then((pluginItem)=>{
|
||||
for(const bot of bots){
|
||||
import(`./plugins/${plugin}`).then((pluginItem) => {
|
||||
for (const bot of bots) {
|
||||
pluginItem.default(bot)
|
||||
}
|
||||
plugins.push(pluginItem.default) // For rejoining
|
||||
|
@ -54,7 +54,7 @@ const createBot = function createBot (host, oldId) {
|
|||
delete bots[oldId]
|
||||
bot.id = oldId
|
||||
bots[oldId] = bot
|
||||
for(const pluginItem of plugins){
|
||||
for (const pluginItem of plugins) {
|
||||
pluginItem(bot)
|
||||
}
|
||||
} else {
|
||||
|
|
136
lang/en-US.js
Normal file
136
lang/en-US.js
Normal file
|
@ -0,0 +1,136 @@
|
|||
export default {
|
||||
'time.week': ' week ',
|
||||
'time.weekPlural': ' weeks ',
|
||||
'time.day': ' day ',
|
||||
'time.dayPlural': ' days ',
|
||||
'time.hour': ' hour ',
|
||||
'time.hourPlural': ' hours ',
|
||||
'time.minute': ' minute ',
|
||||
'time.minutePlural': ' minutes ',
|
||||
'time.second': ' second ',
|
||||
'time.secondPlural': ' seconds ',
|
||||
'chat.antiSpamTriggered': 'Anti-spam has been triggered for this server.',
|
||||
'command.about.usage': '',
|
||||
'command.about.desc': 'About the bot',
|
||||
'command.cb.usage': ' <command>',
|
||||
'command.cb.desc': 'Run a command in a command block',
|
||||
'command.cloop.usage': ' add <rate> <command>|| remove <index>|| list|| clear',
|
||||
'command.cloop.desc': 'Manage command loops',
|
||||
'command.eval.usage': ' <code>',
|
||||
'command.eval.desc': 'Run JavaScript code',
|
||||
'command.help.usage': ' [cmd]',
|
||||
'command.help.desc': 'Shows command help',
|
||||
'command.logoff.usage': '',
|
||||
'command.logoff.desc': 'Disconnect and reconnect the bot from a server',
|
||||
'command.netmsg.usage': ' <message>',
|
||||
'command.netmsg.desc': 'Send a message to all servers the bot is connected to',
|
||||
'command.refill.usage': '',
|
||||
'command.refill.desc': 'Refill core',
|
||||
'command.say.usage': ' <message>',
|
||||
'command.say.desc': 'Sends a message to chat',
|
||||
'command.restart.usage': '',
|
||||
'command.restart.desc': 'Restart bot',
|
||||
'command.stop.usage': '',
|
||||
'command.stop.desc': 'Stop bot',
|
||||
'command.template.usage': ' <required> [optional]',
|
||||
'command.template.desc': 'Does nothing',
|
||||
'command.test.usage': ' [args...]',
|
||||
'command.test.desc': 'Chat parsing debugger command',
|
||||
'command.tpr.usage': '',
|
||||
'command.tpr.desc': 'Teleport to a random location',
|
||||
'command.validate.usage': ' [args...]',
|
||||
'command.validate.desc': 'Check the hashing system',
|
||||
'command.about.author': '%s - a Minecraft bot made by %s for Kaboom and clones',
|
||||
'command.about.version': 'Version %s',
|
||||
'command.about.preRelease': "This is a development version - there may be errors, and features may be changed or removed at any time. Please report any errors to the bot's developer.",
|
||||
'command.about.sourceCode': 'Source code: %s',
|
||||
'command.about.license': 'This bot is free and open-source software and is available under the terms of the MIT license.',
|
||||
'command.about.subcommands': "This command has subcommands to find out more about this bot - try running the commands \"servers\" for a list of Minecraft servers the bot is connected to, or \"serverinfo\" for technical specifications of the bot's server.",
|
||||
'command.about.sourceCode.openInBrowser': 'Click to open the source code link in your default browser',
|
||||
'command.cloop.error.tooShort': 'Command loops must have a rate above 20ms.',
|
||||
'command.cloop.error.subcommand': 'Unknown subcommand, please do %s',
|
||||
'command.cloop.success.add': 'Added command loop with command %s and rate %s',
|
||||
'command.cloop.success.remove': 'Removed command loop %s',
|
||||
'command.cloop.success.clear': 'Cleared all command loops',
|
||||
'command.cloop.list': '%s: Command: %s Rate: %s',
|
||||
'command.eval.output': 'Output',
|
||||
'command.help.cmdList': 'Commands',
|
||||
'command.help.commandInfo': '%s%s - %s',
|
||||
'command.help.commandUsage': 'Usage - %s%s',
|
||||
'command.help.commandDesc': 'Description - %s',
|
||||
'command.help.commandPerms': 'Required permissions - %s',
|
||||
'command.help.commandUsage.lf': 'Usage - %s%s\n',
|
||||
'command.help.commandDesc.lf': 'Description - %s\n',
|
||||
'command.help.commandPerms.lf': 'Required permissions - %s\n',
|
||||
'command.help.commandAliases': 'Aliases - %s',
|
||||
'command.help.runCommand': 'Click to run command',
|
||||
'command.help.permsNormal': 'Public',
|
||||
'command.help.permsTrusted': 'Trusted',
|
||||
'command.help.permsOwner': 'Owner',
|
||||
'command.help.noCommand': 'Command does not exist',
|
||||
'command.help.alias': 'Alias to %s',
|
||||
'command.help.copyAlias': 'Click to copy this alias to your clipboard',
|
||||
'command.netmsg.serverAddress': 'Server Address',
|
||||
'command.test.uuid': 'UUID',
|
||||
'command.test.username': 'Username',
|
||||
'command.test.nickname': 'Nickname',
|
||||
'command.test.command': 'Command',
|
||||
'command.test.msgType': 'Message type',
|
||||
'command.test.msgSubtype': 'Message subtype',
|
||||
'command.test.prefix': 'Prefix',
|
||||
'command.test.args': 'Arguments',
|
||||
'command.test.verify': 'Permission level',
|
||||
'command.test.host': 'Server host',
|
||||
'command.test.port': 'Server port',
|
||||
'command.test.lang': 'Language',
|
||||
'command.test.colorPrimary': 'Primary color',
|
||||
'command.test.colorSecondary': 'Secondary color',
|
||||
'command.about.serverInfo.os.android': 'Android %s',
|
||||
'command.about.serverInfo.os.android.noVersion': 'Android',
|
||||
'command.about.serverInfo.os.freebsd': 'FreeBSD',
|
||||
'command.about.serverInfo.os.linux': 'Linux',
|
||||
'command.about.serverInfo.os.macos': 'macOS',
|
||||
'command.about.serverInfo.os.macos_old': 'OS X',
|
||||
'command.about.serverInfo.os': 'Operating system',
|
||||
'command.about.serverInfo.kernelVer': 'Kernel version',
|
||||
'command.about.serverInfo.processor': 'CPU',
|
||||
'command.about.serverInfo.arch': 'Architecture',
|
||||
'command.about.serverInfo.totalMem': 'Total memory',
|
||||
'command.about.serverInfo.freeMem': 'Free memory',
|
||||
'command.about.serverInfo.usedMem': 'Used memory',
|
||||
'command.about.serverInfo.osUsername': 'Username',
|
||||
'command.about.serverInfo.hostName': 'Hostname',
|
||||
'command.about.serverInfo.workingDir': 'Working directory',
|
||||
'command.about.serverInfo.runTime': 'Bot uptime',
|
||||
'command.about.serverInfo.upTime': 'System uptime',
|
||||
'command.about.serverInfo.nodeVersion': 'Node.js version',
|
||||
'command.about.serverInfo.osRelease': 'Linux release',
|
||||
'command.about.serverInfo.osRelease.missing': '/etc/os-release does not exist. Information may be limited.',
|
||||
'command.about.serverInfo.os.android.version': 'Android version',
|
||||
'command.about.serverInfo.os.android.model': 'Device model',
|
||||
'command.about.serverInfo.botName': 'Bot name',
|
||||
'command.about.serverInfo.botVer': 'Bot version',
|
||||
'command.about.serverListItem': 'Server %s - %s',
|
||||
'command.about.serverListItem.thisServer': 'Server %s - %s (this server)',
|
||||
'command.tpr.success': 'Teleporting %s to %s, %s, %s',
|
||||
'command.verify.success': 'Successfully verified with permission level %s',
|
||||
'command.error': 'An error occured (check console for more info)',
|
||||
'command.disallowed.perms.short': 'You do not have permission to run this command.',
|
||||
'command.disallowed.perms': 'You do not have permission to run this command. If you do have permission, please make sure you put the command hash at the end, or ran the command through the hashing system of your client or proxy.',
|
||||
'command.disallowed.perms.yourLevel': 'Your permission level: %s',
|
||||
'command.disallowed.perms.cmdLevel': 'Command requires: %s',
|
||||
'command.disabled.generic': 'This command has been disabled.',
|
||||
'command.disabled.local': 'This command has been disabled on this server.',
|
||||
'command.disabled.console': 'This command cannot be run from the console.',
|
||||
'command.disabled.nonConsole': 'This command must be run from the console.',
|
||||
'feature.deprecated': '%s will be removed in the future.',
|
||||
'feature.deprecated.replace': '%s will be replaced with %s in the future.',
|
||||
'feature.deprecated.merge': '%s will be merged with %s in the future.',
|
||||
'feature.removed': '%s has been removed.',
|
||||
'feature.removed.replace': '%s has been replaced with %s.',
|
||||
'feature.removed.merge': '%s has been merged with %s.',
|
||||
'feature.removed.plural': '%s have been removed.',
|
||||
'feature.removed.replace.plural': '%s have been replaced with %s.',
|
||||
'feature.removed.merge.plural': '%s have been merged with %s.',
|
||||
copyText: 'Click to copy this item to your clipboard'
|
||||
}
|
138
lang/en-US.json
138
lang/en-US.json
|
@ -1,138 +0,0 @@
|
|||
{
|
||||
"language.name": "English",
|
||||
"language.region": "United States",
|
||||
"time.week": " week ",
|
||||
"time.weekPlural": " weeks ",
|
||||
"time.day": " day ",
|
||||
"time.dayPlural": " days ",
|
||||
"time.hour": " hour ",
|
||||
"time.hourPlural": " hours ",
|
||||
"time.minute": " minute ",
|
||||
"time.minutePlural": " minutes ",
|
||||
"time.second": " second ",
|
||||
"time.secondPlural": " seconds ",
|
||||
"chat.antiSpamTriggered": "Anti-spam has been triggered for this server.",
|
||||
"command.about.usage": "",
|
||||
"command.about.desc": "About the bot",
|
||||
"command.cb.usage": " <command>",
|
||||
"command.cb.desc": "Run a command in a command block",
|
||||
"command.cloop.usage": " add <rate> <command>|| remove <index>|| list|| clear",
|
||||
"command.cloop.desc": "Manage command loops",
|
||||
"command.eval.usage": " <code>",
|
||||
"command.eval.desc": "Run JavaScript code",
|
||||
"command.help.usage": " [cmd]",
|
||||
"command.help.desc": "Shows command help",
|
||||
"command.logoff.usage": "",
|
||||
"command.logoff.desc": "Disconnect and reconnect the bot from a server",
|
||||
"command.netmsg.usage": " <message>",
|
||||
"command.netmsg.desc": "Send a message to all servers the bot is connected to",
|
||||
"command.refill.usage": "",
|
||||
"command.refill.desc": "Refill core",
|
||||
"command.say.usage": " <message>",
|
||||
"command.say.desc": "Sends a message to chat",
|
||||
"command.restart.usage": "",
|
||||
"command.restart.desc": "Restart bot",
|
||||
"command.stop.usage": "",
|
||||
"command.stop.desc": "Stop bot",
|
||||
"command.template.usage": " <required> [optional]",
|
||||
"command.template.desc": "Does nothing",
|
||||
"command.test.usage": " [args...]",
|
||||
"command.test.desc": "Chat parsing debugger command",
|
||||
"command.tpr.usage": "",
|
||||
"command.tpr.desc": "Teleport to a random location",
|
||||
"command.validate.usage": " [args...]",
|
||||
"command.validate.desc": "Check the hashing system",
|
||||
"command.about.author": "%s - a Minecraft bot made by %s for Kaboom and clones",
|
||||
"command.about.version": "Version %s",
|
||||
"command.about.preRelease": "This is a development version - there may be errors, and features may be changed or removed at any time. Please report any errors to the bot's developer.",
|
||||
"command.about.sourceCode": "Source code: %s",
|
||||
"command.about.license": "This bot is free and open-source software and is available under the terms of the MIT license.",
|
||||
"command.about.subcommands": "This command has subcommands to find out more about this bot - try running the commands \"servers\" for a list of Minecraft servers the bot is connected to, or \"serverinfo\" for technical specifications of the bot's server.",
|
||||
"command.about.sourceCode.openInBrowser": "Click to open the source code link in your default browser",
|
||||
"command.cloop.error.tooShort": "Command loops must have a rate above 20ms.",
|
||||
"command.cloop.error.subcommand": "Unknown subcommand, please do %s",
|
||||
"command.cloop.success.add": "Added command loop with command %s and rate %s",
|
||||
"command.cloop.success.remove": "Removed command loop %s",
|
||||
"command.cloop.success.clear": "Cleared all command loops",
|
||||
"command.cloop.list": "%s: Command: %s Rate: %s",
|
||||
"command.eval.output": "Output",
|
||||
"command.help.cmdList": "Commands",
|
||||
"command.help.commandInfo": "%s%s - %s",
|
||||
"command.help.commandUsage": "Usage - %s%s",
|
||||
"command.help.commandDesc": "Description - %s",
|
||||
"command.help.commandPerms": "Required permissions - %s",
|
||||
"command.help.commandUsage.lf": "Usage - %s%s\n",
|
||||
"command.help.commandDesc.lf": "Description - %s\n",
|
||||
"command.help.commandPerms.lf": "Required permissions - %s\n",
|
||||
"command.help.commandAliases": "Aliases - %s",
|
||||
"command.help.runCommand": "Click to run command",
|
||||
"command.help.permsNormal": "Public",
|
||||
"command.help.permsTrusted": "Trusted",
|
||||
"command.help.permsOwner": "Owner",
|
||||
"command.help.noCommand": "Command does not exist",
|
||||
"command.help.alias": "Alias to %s",
|
||||
"command.help.copyAlias": "Click to copy this alias to your clipboard",
|
||||
"command.netmsg.serverAddress": "Server Address",
|
||||
"command.test.uuid": "UUID",
|
||||
"command.test.username": "Username",
|
||||
"command.test.nickname": "Nickname",
|
||||
"command.test.command": "Command",
|
||||
"command.test.msgType": "Message type",
|
||||
"command.test.msgSubtype": "Message subtype",
|
||||
"command.test.prefix": "Prefix",
|
||||
"command.test.args": "Arguments",
|
||||
"command.test.verify": "Permission level",
|
||||
"command.test.host": "Server host",
|
||||
"command.test.port": "Server port",
|
||||
"command.test.lang": "Language",
|
||||
"command.test.colorPrimary": "Primary color",
|
||||
"command.test.colorSecondary": "Secondary color",
|
||||
"command.about.serverInfo.os.android": "Android %s",
|
||||
"command.about.serverInfo.os.android.noVersion": "Android",
|
||||
"command.about.serverInfo.os.freebsd": "FreeBSD",
|
||||
"command.about.serverInfo.os.linux": "Linux",
|
||||
"command.about.serverInfo.os.macos": "macOS",
|
||||
"command.about.serverInfo.os.macos_old": "OS X",
|
||||
"command.about.serverInfo.os": "Operating system",
|
||||
"command.about.serverInfo.kernelVer": "Kernel version",
|
||||
"command.about.serverInfo.processor": "CPU",
|
||||
"command.about.serverInfo.arch": "Architecture",
|
||||
"command.about.serverInfo.totalMem": "Total memory",
|
||||
"command.about.serverInfo.freeMem": "Free memory",
|
||||
"command.about.serverInfo.usedMem": "Used memory",
|
||||
"command.about.serverInfo.osUsername": "Username",
|
||||
"command.about.serverInfo.hostName": "Hostname",
|
||||
"command.about.serverInfo.workingDir": "Working directory",
|
||||
"command.about.serverInfo.runTime": "Bot uptime",
|
||||
"command.about.serverInfo.upTime": "System uptime",
|
||||
"command.about.serverInfo.nodeVersion": "Node.js version",
|
||||
"command.about.serverInfo.osRelease": "Linux release",
|
||||
"command.about.serverInfo.osRelease.missing": "/etc/os-release does not exist. Information may be limited.",
|
||||
"command.about.serverInfo.os.android.version": "Android version",
|
||||
"command.about.serverInfo.os.android.model": "Device model",
|
||||
"command.about.serverInfo.botName": "Bot name",
|
||||
"command.about.serverInfo.botVer": "Bot version",
|
||||
"command.about.serverListItem": "Server %s - %s",
|
||||
"command.about.serverListItem.thisServer": "Server %s - %s (this server)",
|
||||
"command.tpr.success": "Teleporting %s to %s, %s, %s",
|
||||
"command.verify.success": "Successfully verified with permission level %s",
|
||||
"command.error": "An error occured (check console for more info)",
|
||||
"command.disallowed.perms.short": "You do not have permission to run this command.",
|
||||
"command.disallowed.perms": "You do not have permission to run this command. If you do have permission, please make sure you put the command hash at the end, or ran the command through the hashing system of your client or proxy.",
|
||||
"command.disallowed.perms.yourLevel": "Your permission level: %s",
|
||||
"command.disallowed.perms.cmdLevel": "Command requires: %s",
|
||||
"command.disabled.generic": "This command has been disabled.",
|
||||
"command.disabled.local": "This command has been disabled on this server.",
|
||||
"command.disabled.console": "This command cannot be run from the console.",
|
||||
"command.disabled.nonConsole": "This command must be run from the console.",
|
||||
"feature.deprecated": "%s will be removed in the future.",
|
||||
"feature.deprecated.replace": "%s will be replaced with %s in the future.",
|
||||
"feature.deprecated.merge": "%s will be merged with %s in the future.",
|
||||
"feature.removed": "%s has been removed.",
|
||||
"feature.removed.replace": "%s has been replaced with %s.",
|
||||
"feature.removed.merge": "%s has been merged with %s.",
|
||||
"feature.removed.plural": "%s have been removed.",
|
||||
"feature.removed.replace.plural": "%s have been replaced with %s.",
|
||||
"feature.removed.merge.plural": "%s have been merged with %s.",
|
||||
"copyText": "Click to copy this item to your clipboard"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import chatlog from '../util/chatlog.js'
|
||||
import { readdirSync, mkdirSync } from "node:fs"
|
||||
import { default as settings } from '../settings.js'
|
||||
import { readdirSync, mkdirSync } from 'node:fs'
|
||||
import settings from '../settings.js'
|
||||
|
||||
const checkLog = () => {
|
||||
if (settings.disableLogging) return
|
||||
|
@ -20,7 +20,6 @@ const checkLog = () => {
|
|||
setInterval(checkLog, 3600000) // Runs once every hour,
|
||||
checkLog() // and at bot startup.
|
||||
|
||||
|
||||
export default function load (b) {
|
||||
b.on('plainchat', (msg, type) => {
|
||||
if (!settings.disableLogging && !settings.disableChatLogging) chatlog(`chat_${b.host.host}_${b.host.port}`, `[${type}] ${msg}`)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import cmds from "../util/commands.js"
|
||||
import { default as settings } from '../settings.js'
|
||||
import cmds from '../util/commands.js'
|
||||
import settings from '../settings.js'
|
||||
import Command from '../util/Command.js'
|
||||
export default function load (b) {
|
||||
b.on('chat', (data) => {
|
||||
|
@ -11,18 +11,18 @@ export default function load (b) {
|
|||
}
|
||||
}
|
||||
})
|
||||
b.runCommand = function (user, nick, uuid, command, type, subtype, prefix){
|
||||
const context = new Command(uuid, user, nick, command, "minecraft", type, subtype, prefix, b, 0)
|
||||
b.runCommand = function (user, nick, uuid, command, type, subtype, prefix) {
|
||||
const context = new Command(uuid, user, nick, command, 'minecraft', type, subtype, prefix, b, 0)
|
||||
|
||||
b.emit('command', context)
|
||||
|
||||
if(cmds[context.cmdName.toLowerCase()]){
|
||||
if (cmds[context.cmdName.toLowerCase()]) {
|
||||
try {
|
||||
cmds[context.cmdName.toLowerCase()].execute(context)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
context.reply({
|
||||
text: "An error occured (check console)"
|
||||
text: 'An error occured (check console)'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { default as uuidToInt } from '../util/uuidtoint.js'
|
||||
import { default as plainParser } from '../util/chatparse_plain.js'
|
||||
import { default as mcParser } from '../util/chatparse_mc.js'
|
||||
import uuidToInt from '../util/uuidtoint.js'
|
||||
import plainParser from '../util/chatparse_plain.js'
|
||||
import mcParser from '../util/chatparse_mc.js'
|
||||
const cs = {
|
||||
x: 4,
|
||||
y: 6,
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import { createInterface, cursorTo, clearLine } from "node:readline"
|
||||
import { default as settings } from '../settings.js'
|
||||
import cmds from "../util/commands.js"
|
||||
import { bots } from "../index.js"
|
||||
import { createInterface, cursorTo, clearLine } from 'node:readline'
|
||||
import settings from '../settings.js'
|
||||
import cmds from '../util/commands.js'
|
||||
import { bots } from '../index.js'
|
||||
import Command from '../util/Command.js'
|
||||
import parse2 from "../util/chatparse_console.js"
|
||||
import { userInfo } from "node:os"
|
||||
import parse2 from '../util/chatparse_console.js'
|
||||
import { userInfo } from 'node:os'
|
||||
|
||||
const consoleBotStub = {
|
||||
host: {
|
||||
host: "bot console ",
|
||||
host: 'bot console ',
|
||||
port: 3
|
||||
},
|
||||
tellraw: (_unused, data) => console.log(parse2(data))
|
||||
}
|
||||
const uuid = "4d616465-6c69-6e65-2075-7775203a3300"
|
||||
const uuid = '4d616465-6c69-6e65-2075-7775203a3300'
|
||||
const user = userInfo().username // OS user the bot is running as
|
||||
const nick = "console"
|
||||
const nick = user
|
||||
|
||||
const rl = createInterface({
|
||||
input: process.stdin,
|
||||
|
@ -29,16 +29,16 @@ rl.on('line', (l) => {
|
|||
const tmpcmd = l.split(' ')
|
||||
const index2 = tmpcmd.splice(1, 1)[0]
|
||||
if (index2 === '*') {
|
||||
for (let i = 0; i < index.bots.length; i++) {
|
||||
const cmd = new Command(uuid, user, nick, tmpcmd.join(' '), "console", "console", "console", "", bots[i], 2, {})
|
||||
for (let i = 0; i < bots.length; i++) {
|
||||
const cmd = new Command(uuid, user, nick, tmpcmd.join(' '), 'console', 'console', 'console', '', bots[i], 2, {})
|
||||
cmds[l.split(' ')[0].toLowerCase()].execute(cmd)
|
||||
}
|
||||
} else {
|
||||
const cmd = new Command(uuid, user, nick, tmpcmd.join(' '), "console", "console", "console", "", bots[+index2], 2, {})
|
||||
const cmd = new Command(uuid, user, nick, tmpcmd.join(' '), 'console', 'console', 'console', '', bots[+index2], 2, {})
|
||||
cmds[l.split(' ')[0].toLowerCase()].execute(cmd)
|
||||
}
|
||||
} else {
|
||||
const cmd = new Command(uuid, user, nick, l, "console", "console", "console", "", consoleBotStub, 2, {})
|
||||
const cmd = new Command(uuid, user, nick, l, 'console', 'console', 'console', '', consoleBotStub, 2, {})
|
||||
cmds[l.split(' ')[0].toLowerCase()].execute(cmd)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { default as settings } from '../settings.js'
|
||||
import { default as version } from '../version.json' with {type: "json"}
|
||||
import { bots } from "../index.js"
|
||||
import botVersion from "../util/version.js"
|
||||
import settings from '../settings.js'
|
||||
import version from '../version.js'
|
||||
import { bots } from '../index.js'
|
||||
import botVersion from '../util/version.js'
|
||||
import chatlog from '../util/chatlog.js'
|
||||
|
||||
process.on("uncaughtException",(e, o)=>{
|
||||
for(const i in bots){
|
||||
try{
|
||||
bots[i].ccq[0]=`/tellraw ${version.botAuthor} ${
|
||||
process.on('uncaughtException', (e, o) => {
|
||||
for (const i in bots) {
|
||||
try {
|
||||
bots[i].ccq[0] = `/tellraw ${version.botAuthor} ${
|
||||
JSON.stringify({
|
||||
translate: "%s\n",
|
||||
translate: '%s\n',
|
||||
color: settings.colors.fatalError,
|
||||
with: [
|
||||
`An error occured and ${version.botName} will now shut down.`
|
||||
|
@ -17,9 +17,9 @@ process.on("uncaughtException",(e, o)=>{
|
|||
})
|
||||
}`
|
||||
bots[i].advanceccq()
|
||||
const stack = e.stack.split("\n")
|
||||
for(const item of stack){
|
||||
bots[i].ccq[0]=`/tellraw ${version.botAuthor} ${
|
||||
const stack = e.stack.split('\n')
|
||||
for (const item of stack) {
|
||||
bots[i].ccq[0] = `/tellraw ${version.botAuthor} ${
|
||||
JSON.stringify({
|
||||
text: item,
|
||||
color: settings.colors.fatalError
|
||||
|
@ -27,13 +27,13 @@ process.on("uncaughtException",(e, o)=>{
|
|||
}`
|
||||
bots[i].advanceccq()
|
||||
}
|
||||
bots[i].ccq[0]=`/tellraw ${version.botAuthor} ${
|
||||
bots[i].ccq[0] = `/tellraw ${version.botAuthor} ${
|
||||
JSON.stringify({
|
||||
translate: "\n%s",
|
||||
translate: '\n%s',
|
||||
color: settings.colors.fatalError,
|
||||
with: [
|
||||
[
|
||||
"Additional info:\n",
|
||||
'Additional info:\n',
|
||||
`Bot version: ${botVersion}`
|
||||
]
|
||||
]
|
||||
|
@ -42,7 +42,7 @@ process.on("uncaughtException",(e, o)=>{
|
|||
bots[i].advanceccq() // Force the command queue to advance
|
||||
} catch (e) {}
|
||||
}
|
||||
chatlog("error", e.stack)
|
||||
chatlog('error', e.stack)
|
||||
console.error(e)
|
||||
process.exit(1)
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { default as parse } from '../util/chatparse_plain.js'
|
||||
import { default as parseNBT } from '../util/parseNBT.js'
|
||||
import parse from '../util/chatparse_plain.js'
|
||||
import parseNBT from '../util/parseNBT.js'
|
||||
|
||||
export default function load (b) {
|
||||
b.players = {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { createBot } from "../index.js"
|
||||
import { createBot } from '../index.js'
|
||||
export default function load (b) {
|
||||
b._client.on('end', () => {
|
||||
b.info(`Bot ${b.id} disconnected`)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||
import { default as parseMc } from '../util/chatparse_mc_withHex.js'
|
||||
import { default as settings } from '../settings.js'
|
||||
import { default as version } from '../version.json' with {type: "json"}
|
||||
import parsePlain from '../util/chatparse_plain.js'
|
||||
import parseMc from '../util/chatparse_mc_withHex.js'
|
||||
import settings from '../settings.js'
|
||||
import version from '../version.js'
|
||||
class SCTask {
|
||||
constructor (failTask, startFailed = false) {
|
||||
/*
|
||||
|
@ -13,11 +13,10 @@ class SCTask {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
export default function load (b) {
|
||||
b.sc_tasks = {}
|
||||
b.selfcareRun = 0
|
||||
b._client.on("login", ()=>{
|
||||
b._client.on('login', () => {
|
||||
b.interval.sc = setInterval(() => {
|
||||
if (Date.now() - b.selfcareRun <= 600) {
|
||||
return
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { default as settings } from '../settings.js'
|
||||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||
import { default as parseConsole } from '../util/chatparse_console.js'
|
||||
import { default as parse1204 } from '../util/parseNBT.js'
|
||||
import settings from '../settings.js'
|
||||
import parsePlain from '../util/chatparse_plain.js'
|
||||
import parseConsole from '../util/chatparse_console.js'
|
||||
import parse1204 from '../util/parseNBT.js'
|
||||
import { getMessage } from '../util/lang.js'
|
||||
import { readdirSync } from "node:fs"
|
||||
import { readdirSync } from 'node:fs'
|
||||
const convertChatStyleItem = (item) => {
|
||||
const output = {}
|
||||
for (const i in item) {
|
||||
|
@ -38,13 +38,12 @@ for (const plugin of bpl) {
|
|||
continue
|
||||
}
|
||||
try {
|
||||
import(`../chatParsers/${plugin}`).then((pluginItem)=>{
|
||||
import(`../chatParsers/${plugin}`).then((pluginItem) => {
|
||||
parsers[pluginItem.priority].push(pluginItem.parse)
|
||||
})
|
||||
} catch (e) { console.log(e) }
|
||||
}
|
||||
|
||||
|
||||
export default function load (b) {
|
||||
b.messageCount = 0
|
||||
b.chatDisabledUntil = 0
|
||||
|
@ -58,16 +57,16 @@ export default function load (b) {
|
|||
nbtItems.forEach((item, i) => {
|
||||
b.messageTypes[i] = convertChatTypeItem(item.element.value.chat.value)
|
||||
})
|
||||
} else if(data.entries && data.id == 'minecraft:chat_type'){
|
||||
data.entries.forEach((item, i)=>{
|
||||
} else if (data.entries && data.id === 'minecraft:chat_type') {
|
||||
data.entries.forEach((item, i) => {
|
||||
b.messageTypes[i] = convertChatTypeItem(data.entries[i].value.value.chat.value)
|
||||
})
|
||||
}
|
||||
})
|
||||
b._client.on('profileless_chat', (data) => {
|
||||
let messageType;
|
||||
if(data.type.registryIndex){
|
||||
messageType = b.messageTypes[data.type.registryIndex-1]
|
||||
let messageType
|
||||
if (data.type.registryIndex) {
|
||||
messageType = b.messageTypes[data.type.registryIndex - 1]
|
||||
} else {
|
||||
messageType = b.messageTypes[data.type]
|
||||
}
|
||||
|
@ -101,9 +100,9 @@ export default function load (b) {
|
|||
})
|
||||
|
||||
b._client.on('player_chat', (data) => {
|
||||
let messageType;
|
||||
if(data.type.registryIndex){
|
||||
messageType = b.messageTypes[data.type.registryIndex-1]
|
||||
let messageType
|
||||
if (data.type.registryIndex) {
|
||||
messageType = b.messageTypes[data.type.registryIndex - 1]
|
||||
} else {
|
||||
messageType = b.messageTypes[data.type]
|
||||
}
|
||||
|
|
|
@ -1,37 +1,36 @@
|
|||
export default {
|
||||
"terminalMode": "blackTerminal_24bit",
|
||||
"version_mc": "1.21.1",
|
||||
"displaySubtypesToConsole": true,
|
||||
"defaultLang": "en-US",
|
||||
"colors": {
|
||||
"secondary": "#DD99FF",
|
||||
"primary": "#EECCFF",
|
||||
"tertiary": "white",
|
||||
"warning": "#FFAA33",
|
||||
"error": "#FF6688",
|
||||
"fatalError": "#BB3344"
|
||||
},
|
||||
"prefixes": [
|
||||
"ubotesm:",
|
||||
"ubotdev:",
|
||||
"es\"",
|
||||
"d\""
|
||||
],
|
||||
"servers": [
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
"port": 25565,
|
||||
"options": {
|
||||
"name": "kaboom"
|
||||
}
|
||||
},
|
||||
{
|
||||
terminalMode: 'blackTerminal_24bit', // Terminal mode. Most modern terminals support 24-bit color
|
||||
version_mc: '1.21.1', // Minecraft version to connect with
|
||||
defaultLang: 'en-US', // Default language
|
||||
colors: { // All colors the bot uses
|
||||
secondary: '#DD99FF',
|
||||
primary: '#EECCFF',
|
||||
tertiary: 'white',
|
||||
warning: '#FFAA33',
|
||||
error: '#FF6688',
|
||||
fatalError: '#BB3344'
|
||||
},
|
||||
prefixes: [ // A list of prefixes the bot will respond to in-game
|
||||
'ubotesm:',
|
||||
'ubotdev:',
|
||||
'es"',
|
||||
'd"'
|
||||
],
|
||||
servers: [ // Server list
|
||||
{
|
||||
host: 'kaboom.pw', // Server address
|
||||
port: 25565, // Server port. The default is 25565.
|
||||
options: {
|
||||
name: 'kaboom' // Server name in netmsg
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
"host": "chipmunk.land",
|
||||
"port": 25565,
|
||||
"options": {
|
||||
"name": "chipmunk"
|
||||
}
|
||||
}
|
||||
]
|
||||
host: 'chipmunk.land',
|
||||
port: 25565,
|
||||
options: {
|
||||
name: 'chipmunk'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import { default as settings } from '../settings.js'
|
||||
import settings from '../settings.js'
|
||||
export default class Command {
|
||||
constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot, verify) {
|
||||
this.uuid=uuid;
|
||||
this.reply = text => bot.tellraw(uuid, text)
|
||||
this.username = user;
|
||||
this.nickname = nick;
|
||||
this.command = cmd;
|
||||
this.type = senderType;
|
||||
this.msgType = msgType;
|
||||
this.msgSubtype = msgSubtype;
|
||||
this.args = cmd.split(' ').slice(1)
|
||||
this.cmdName = cmd.split(' ')[0]
|
||||
this.prefix = prefix
|
||||
this.colors = settings.colors
|
||||
this.lang = settings.defaultLang
|
||||
this.verify = verify
|
||||
this.host = bot.host.host
|
||||
this.port = bot.host.port
|
||||
this.bot = bot
|
||||
}
|
||||
constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot, verify) {
|
||||
this.uuid = uuid
|
||||
this.reply = text => bot.tellraw(uuid, text)
|
||||
this.username = user
|
||||
this.nickname = nick
|
||||
this.command = cmd
|
||||
this.type = senderType
|
||||
this.msgType = msgType
|
||||
this.msgSubtype = msgSubtype
|
||||
this.args = cmd.split(' ').slice(1)
|
||||
this.cmdName = cmd.split(' ')[0]
|
||||
this.prefix = prefix
|
||||
this.colors = settings.colors
|
||||
this.lang = settings.defaultLang
|
||||
this.verify = verify
|
||||
this.host = bot.host.host
|
||||
this.port = bot.host.port
|
||||
this.bot = bot
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import { appendFileSync } from 'node:fs'
|
||||
import { default as settings } from '../settings.js'
|
||||
import settings from '../settings.js'
|
||||
|
||||
export default function chatlog (fileName, item) {
|
||||
if (settings.disableLogging) return
|
||||
|
|
|
@ -1,6 +1,188 @@
|
|||
import { default as settings } from '../settings.js'
|
||||
import settings from '../settings.js'
|
||||
import lang from './mc_lang.js'
|
||||
import { default as _consoleColors } from './consolecolors.json' with {type: "json"}
|
||||
|
||||
const _consoleColors = {
|
||||
blackTerminal_24bit: {
|
||||
fourBit: {
|
||||
dark_red: '\u001B[0;38;2;170;0;0m',
|
||||
red: '\u001B[0;38;2;255;85;85m',
|
||||
dark_green: '\u001B[0;38;2;0;170;0m',
|
||||
green: '\u001B[0;38;2;85;255;85m',
|
||||
gold: '\u001B[0;38;2;255;170;0m',
|
||||
yellow: '\u001B[0;38;2;255;255;85m',
|
||||
dark_blue: '\u001B[0;38;2;0;0;170m',
|
||||
blue: '\u001B[0;38;2;85;85;255m',
|
||||
dark_purple: '\u001B[0;38;2;170;0;170m',
|
||||
light_purple: '\u001B[0;38;2;255;85;255m',
|
||||
dark_aqua: '\u001B[0;38;2;0;170;170m',
|
||||
aqua: '\u001B[0;38;2;85;255;255m',
|
||||
black: '\u001B[0;48;2;220;220;220;38;2;0;0;0m',
|
||||
gray: '\u001B[0;38;2;170;170;170m',
|
||||
dark_gray: '\u001B[0;38;2;85;85;85m',
|
||||
white: '\u001B[0;38;2;255;255;255m',
|
||||
reset: '\u001B[0;38;2;255;255;255m'
|
||||
},
|
||||
twentyFourBit: {
|
||||
enabled: true,
|
||||
bit: 24,
|
||||
lightMode: false
|
||||
}
|
||||
},
|
||||
whiteTerminal_24bit: {
|
||||
fourBit: {
|
||||
dark_red: '\u001B[0;38;2;170;0;0m',
|
||||
red: '\u001B[0;38;2;255;85;85m',
|
||||
dark_green: '\u001B[0;38;2;0;170;0m',
|
||||
green: '\u001B[0;48;2;20;20;20;38;2;85;255;85m',
|
||||
gold: '\u001B[0;38;2;255;170;0m',
|
||||
yellow: '\u001B[0;48;2;20;20;20;38;2;255;255;85m',
|
||||
dark_blue: '\u001B[0;38;2;0;0;170m',
|
||||
blue: '\u001B[0;38;2;85;85;255m',
|
||||
dark_purple: '\u001B[0;38;2;170;0;170m',
|
||||
light_purple: '\u001B[0;38;2;255;85;255m',
|
||||
dark_aqua: '\u001B[0;38;2;0;170;170m',
|
||||
aqua: '\u001B[0;48;2;20;20;20;38;2;85;255;255m',
|
||||
black: '\u001B[0;38;2;0;0;0m',
|
||||
gray: '\u001B[0;38;2;170;170;170m',
|
||||
dark_gray: '\u001B[0;38;2;85;85;85m',
|
||||
white: '\u001B[0;48;2;20;20;20;38;2;255;255;255m',
|
||||
reset: '\u001B[0;48;2;20;20;20;38;2;255;255;255m'
|
||||
},
|
||||
twentyFourBit: {
|
||||
enabled: true,
|
||||
bit: 24,
|
||||
lightMode: true
|
||||
}
|
||||
},
|
||||
blackTerminal_8bit: {
|
||||
fourBit: {
|
||||
dark_red: '\u001B[0;38;5;124m',
|
||||
red: '\u001B[0;38;5;203m',
|
||||
dark_green: '\u001B[0;38;5;34m',
|
||||
green: '\u001B[0;38;5;83m',
|
||||
gold: '\u001B[0;38;5;214m',
|
||||
yellow: '\u001B[0;38;5;227m',
|
||||
dark_blue: '\u001B[0;38;5;19m',
|
||||
blue: '\u001B[0;38;5;63m',
|
||||
dark_purple: '\u001B[0;38;5;127m',
|
||||
light_purple: '\u001B[0;38;5;207m',
|
||||
dark_aqua: '\u001B[0;38;5;37m',
|
||||
aqua: '\u001B[0;38;5;87m',
|
||||
black: '\u001B[0;48;5;253;38;5;16m',
|
||||
gray: '\u001B[0;38;5;145m',
|
||||
dark_gray: '\u001B[0;38;5;59m',
|
||||
white: '\u001B[0;38;5;231m',
|
||||
reset: '\u001B[0;38;5;231m'
|
||||
},
|
||||
twentyFourBit: {
|
||||
enabled: true,
|
||||
bit: 8,
|
||||
lightMode: false
|
||||
}
|
||||
},
|
||||
whiteTerminal_8bit: {
|
||||
fourBit: {
|
||||
dark_red: '\u001B[0;38;5;124m',
|
||||
red: '\u001B[0;38;5;203m',
|
||||
dark_green: '\u001B[0;38;5;34m',
|
||||
green: '\u001B[0;48;5;16;38;5;83m',
|
||||
gold: '\u001B[0;38;5;214m',
|
||||
yellow: '\u001B[0;48;5;16;38;5;227m',
|
||||
dark_blue: '\u001B[0;38;5;19m',
|
||||
blue: '\u001B[0;38;5;63m',
|
||||
dark_purple: '\u001B[0;38;5;127m',
|
||||
light_purple: '\u001B[0;38;5;207m',
|
||||
dark_aqua: '\u001B[0;38;5;37m',
|
||||
aqua: '\u001B[0;48;5;16;38;5;87m',
|
||||
black: '\u001B[0;38;5;16m',
|
||||
gray: '\u001B[0;38;5;145m',
|
||||
dark_gray: '\u001B[0;38;5;59m',
|
||||
white: '\u001B[0;48;5;16;38;5;231m',
|
||||
reset: '\u001B[0;48;5;16;38;5;231m'
|
||||
},
|
||||
twentyFourBit: {
|
||||
enabled: true,
|
||||
bit: 8,
|
||||
lightMode: true
|
||||
}
|
||||
},
|
||||
blackTerminal_4bit: {
|
||||
fourBit: {
|
||||
dark_red: '\u001B[0;31m',
|
||||
red: '\u001B[0;1;31m',
|
||||
dark_green: '\u001B[0;32m',
|
||||
green: '\u001B[0;1;32m',
|
||||
gold: '\u001B[0;33m',
|
||||
yellow: '\u001B[0;1;33m',
|
||||
dark_blue: '\u001B[0;34m',
|
||||
blue: '\u001B[0;1;34m',
|
||||
dark_purple: '\u001B[0;35m',
|
||||
light_purple: '\u001B[0;1;35m',
|
||||
dark_aqua: '\u001B[0;36m',
|
||||
aqua: '\u001B[0;1;36m',
|
||||
black: '\u001B[0;1;47;30m',
|
||||
gray: '\u001B[0;37m',
|
||||
dark_gray: '\u001B[0;1;30m',
|
||||
white: '\u001B[0;1;37m',
|
||||
reset: '\u001B[0;1;37m'
|
||||
},
|
||||
twentyFourBit: {
|
||||
enabled: true,
|
||||
bit: 4,
|
||||
lightMode: false
|
||||
}
|
||||
},
|
||||
whiteTerminal_4bit: {
|
||||
fourBit: {
|
||||
dark_red: '\u001B[0;31m',
|
||||
red: '\u001B[0;1;31m',
|
||||
dark_green: '\u001B[0;32m',
|
||||
green: '\u001B[0;40;1;32m',
|
||||
gold: '\u001B[0;33m',
|
||||
yellow: '\u001B[0;40;1;33m',
|
||||
dark_blue: '\u001B[0;34m',
|
||||
blue: '\u001B[0;1;34m',
|
||||
dark_purple: '\u001B[0;35m',
|
||||
light_purple: '\u001B[0;1;35m',
|
||||
dark_aqua: '\u001B[0;36m',
|
||||
aqua: '\u001B[0;40;1;36m',
|
||||
black: '\u001B[0;30m',
|
||||
gray: '\u001B[0;37m',
|
||||
dark_gray: '\u001B[0;1;30m',
|
||||
white: '\u001B[0;40;1;37m',
|
||||
reset: '\u001B[0;40;1;37m'
|
||||
},
|
||||
twentyFourBit: {
|
||||
enabled: true,
|
||||
bit: 4,
|
||||
lightMode: true
|
||||
}
|
||||
},
|
||||
none: {
|
||||
fourBit: {
|
||||
dark_red: '',
|
||||
red: '',
|
||||
dark_green: '',
|
||||
green: '',
|
||||
gold: '',
|
||||
yellow: '',
|
||||
dark_blue: '',
|
||||
blue: '',
|
||||
dark_purple: '',
|
||||
light_purple: '',
|
||||
dark_aqua: '',
|
||||
aqua: '',
|
||||
black: '',
|
||||
gray: '',
|
||||
dark_gray: '',
|
||||
white: '',
|
||||
reset: ''
|
||||
},
|
||||
twentyFourBit: {
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let consoleColors
|
||||
let consoleColors24
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const cmds = Object.create(null)
|
||||
import { readdirSync } from 'node:fs'
|
||||
|
||||
import { readdirSync } from "node:fs"
|
||||
const cmds = Object.create(null)
|
||||
const bpl = readdirSync('commands')
|
||||
|
||||
for (const plugin of bpl) {
|
||||
|
@ -9,20 +9,20 @@ for (const plugin of bpl) {
|
|||
}
|
||||
try {
|
||||
const commandName = plugin.split('.js')[0]
|
||||
import(`../commands/${plugin}`).then((pluginItem)=>{
|
||||
cmds[commandName] = pluginItem // For rejoining
|
||||
if (cmds[commandName].aliases) {
|
||||
for (const j in cmds[commandName].aliases) {
|
||||
cmds[cmds[commandName].aliases[j]] = {
|
||||
execute: cmds[commandName].execute,
|
||||
alias: commandName,
|
||||
usage: cmds[commandName].usage,
|
||||
level: cmds[commandName].level,
|
||||
hidden: true,
|
||||
consoleIndex: cmds[commandName].consoleIndex
|
||||
}
|
||||
import(`../commands/${plugin}`).then((pluginItem) => {
|
||||
cmds[commandName] = pluginItem // For rejoining
|
||||
if (cmds[commandName].aliases) {
|
||||
for (const j in cmds[commandName].aliases) {
|
||||
cmds[cmds[commandName].aliases[j]] = {
|
||||
execute: cmds[commandName].execute,
|
||||
alias: commandName,
|
||||
usage: cmds[commandName].usage,
|
||||
level: cmds[commandName].level,
|
||||
hidden: true,
|
||||
consoleIndex: cmds[commandName].consoleIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) { console.log(e) }
|
||||
}
|
||||
|
|
|
@ -1,182 +0,0 @@
|
|||
{
|
||||
"blackTerminal_24bit":{
|
||||
"fourBit":{
|
||||
"dark_red": "\u001B[0;38;2;170;0;0m",
|
||||
"red": "\u001B[0;38;2;255;85;85m",
|
||||
"dark_green": "\u001B[0;38;2;0;170;0m",
|
||||
"green": "\u001B[0;38;2;85;255;85m",
|
||||
"gold": "\u001B[0;38;2;255;170;0m",
|
||||
"yellow": "\u001B[0;38;2;255;255;85m",
|
||||
"dark_blue": "\u001B[0;38;2;0;0;170m",
|
||||
"blue": "\u001B[0;38;2;85;85;255m",
|
||||
"dark_purple": "\u001B[0;38;2;170;0;170m",
|
||||
"light_purple": "\u001B[0;38;2;255;85;255m",
|
||||
"dark_aqua": "\u001B[0;38;2;0;170;170m",
|
||||
"aqua": "\u001B[0;38;2;85;255;255m",
|
||||
"black": "\u001B[0;48;2;220;220;220;38;2;0;0;0m",
|
||||
"gray": "\u001B[0;38;2;170;170;170m",
|
||||
"dark_gray": "\u001B[0;38;2;85;85;85m",
|
||||
"white": "\u001B[0;38;2;255;255;255m",
|
||||
"reset": "\u001B[0;38;2;255;255;255m"
|
||||
},
|
||||
"twentyFourBit":{
|
||||
"enabled": true,
|
||||
"bit": 24,
|
||||
"lightMode": false
|
||||
}
|
||||
},
|
||||
"whiteTerminal_24bit":{
|
||||
"fourBit":{
|
||||
"dark_red": "\u001B[0;38;2;170;0;0m",
|
||||
"red": "\u001B[0;38;2;255;85;85m",
|
||||
"dark_green": "\u001B[0;38;2;0;170;0m",
|
||||
"green": "\u001B[0;48;2;20;20;20;38;2;85;255;85m",
|
||||
"gold": "\u001B[0;38;2;255;170;0m",
|
||||
"yellow": "\u001B[0;48;2;20;20;20;38;2;255;255;85m",
|
||||
"dark_blue": "\u001B[0;38;2;0;0;170m",
|
||||
"blue": "\u001B[0;38;2;85;85;255m",
|
||||
"dark_purple": "\u001B[0;38;2;170;0;170m",
|
||||
"light_purple": "\u001B[0;38;2;255;85;255m",
|
||||
"dark_aqua": "\u001B[0;38;2;0;170;170m",
|
||||
"aqua": "\u001B[0;48;2;20;20;20;38;2;85;255;255m",
|
||||
"black": "\u001B[0;38;2;0;0;0m",
|
||||
"gray": "\u001B[0;38;2;170;170;170m",
|
||||
"dark_gray": "\u001B[0;38;2;85;85;85m",
|
||||
"white": "\u001B[0;48;2;20;20;20;38;2;255;255;255m",
|
||||
"reset": "\u001B[0;48;2;20;20;20;38;2;255;255;255m"
|
||||
},
|
||||
"twentyFourBit":{
|
||||
"enabled": true,
|
||||
"bit": 24,
|
||||
"lightMode": true
|
||||
}
|
||||
},
|
||||
"blackTerminal_8bit":{
|
||||
"fourBit":{
|
||||
"dark_red": "\u001B[0;38;5;124m",
|
||||
"red": "\u001B[0;38;5;203m",
|
||||
"dark_green": "\u001B[0;38;5;34m",
|
||||
"green": "\u001B[0;38;5;83m",
|
||||
"gold": "\u001B[0;38;5;214m",
|
||||
"yellow": "\u001B[0;38;5;227m",
|
||||
"dark_blue": "\u001B[0;38;5;19m",
|
||||
"blue": "\u001B[0;38;5;63m",
|
||||
"dark_purple": "\u001B[0;38;5;127m",
|
||||
"light_purple": "\u001B[0;38;5;207m",
|
||||
"dark_aqua": "\u001B[0;38;5;37m",
|
||||
"aqua": "\u001B[0;38;5;87m",
|
||||
"black": "\u001B[0;48;5;253;38;5;16m",
|
||||
"gray": "\u001B[0;38;5;145m",
|
||||
"dark_gray": "\u001B[0;38;5;59m",
|
||||
"white": "\u001B[0;38;5;231m",
|
||||
"reset": "\u001B[0;38;5;231m"
|
||||
},
|
||||
"twentyFourBit":{
|
||||
"enabled": true,
|
||||
"bit": 8,
|
||||
"lightMode": false
|
||||
}
|
||||
},
|
||||
"whiteTerminal_8bit":{
|
||||
"fourBit":{
|
||||
"dark_red": "\u001B[0;38;5;124m",
|
||||
"red": "\u001B[0;38;5;203m",
|
||||
"dark_green": "\u001B[0;38;5;34m",
|
||||
"green": "\u001B[0;48;5;16;38;5;83m",
|
||||
"gold": "\u001B[0;38;5;214m",
|
||||
"yellow": "\u001B[0;48;5;16;38;5;227m",
|
||||
"dark_blue": "\u001B[0;38;5;19m",
|
||||
"blue": "\u001B[0;38;5;63m",
|
||||
"dark_purple": "\u001B[0;38;5;127m",
|
||||
"light_purple": "\u001B[0;38;5;207m",
|
||||
"dark_aqua": "\u001B[0;38;5;37m",
|
||||
"aqua": "\u001B[0;48;5;16;38;5;87m",
|
||||
"black": "\u001B[0;38;5;16m",
|
||||
"gray": "\u001B[0;38;5;145m",
|
||||
"dark_gray": "\u001B[0;38;5;59m",
|
||||
"white": "\u001B[0;48;5;16;38;5;231m",
|
||||
"reset": "\u001B[0;48;5;16;38;5;231m"
|
||||
},
|
||||
"twentyFourBit":{
|
||||
"enabled": true,
|
||||
"bit": 8,
|
||||
"lightMode": true
|
||||
}
|
||||
},
|
||||
"blackTerminal_4bit":{
|
||||
"fourBit":{
|
||||
"dark_red": "\u001B[0;31m",
|
||||
"red": "\u001B[0;1;31m",
|
||||
"dark_green": "\u001B[0;32m",
|
||||
"green": "\u001B[0;1;32m",
|
||||
"gold": "\u001B[0;33m",
|
||||
"yellow": "\u001B[0;1;33m",
|
||||
"dark_blue": "\u001B[0;34m",
|
||||
"blue": "\u001B[0;1;34m",
|
||||
"dark_purple": "\u001B[0;35m",
|
||||
"light_purple": "\u001B[0;1;35m",
|
||||
"dark_aqua": "\u001B[0;36m",
|
||||
"aqua": "\u001B[0;1;36m",
|
||||
"black": "\u001B[0;1;47;30m",
|
||||
"gray": "\u001B[0;37m",
|
||||
"dark_gray": "\u001B[0;1;30m",
|
||||
"white": "\u001B[0;1;37m",
|
||||
"reset": "\u001B[0;1;37m"
|
||||
},
|
||||
"twentyFourBit":{
|
||||
"enabled": true,
|
||||
"bit": 4,
|
||||
"lightMode": false
|
||||
}
|
||||
},
|
||||
"whiteTerminal_4bit":{
|
||||
"fourBit":{
|
||||
"dark_red": "\u001B[0;31m",
|
||||
"red": "\u001B[0;1;31m",
|
||||
"dark_green": "\u001B[0;32m",
|
||||
"green": "\u001B[0;40;1;32m",
|
||||
"gold": "\u001B[0;33m",
|
||||
"yellow": "\u001B[0;40;1;33m",
|
||||
"dark_blue": "\u001B[0;34m",
|
||||
"blue": "\u001B[0;1;34m",
|
||||
"dark_purple": "\u001B[0;35m",
|
||||
"light_purple": "\u001B[0;1;35m",
|
||||
"dark_aqua": "\u001B[0;36m",
|
||||
"aqua": "\u001B[0;40;1;36m",
|
||||
"black": "\u001B[0;30m",
|
||||
"gray": "\u001B[0;37m",
|
||||
"dark_gray": "\u001B[0;1;30m",
|
||||
"white": "\u001B[0;40;1;37m",
|
||||
"reset": "\u001B[0;40;1;37m"
|
||||
},
|
||||
"twentyFourBit":{
|
||||
"enabled": true,
|
||||
"bit": 4,
|
||||
"lightMode": true
|
||||
}
|
||||
},
|
||||
"none":{
|
||||
"fourBit":{
|
||||
"dark_red": "",
|
||||
"red": "",
|
||||
"dark_green": "",
|
||||
"green": "",
|
||||
"gold": "",
|
||||
"yellow": "",
|
||||
"dark_blue": "",
|
||||
"blue": "",
|
||||
"dark_purple": "",
|
||||
"light_purple": "",
|
||||
"dark_aqua": "",
|
||||
"aqua": "",
|
||||
"black": "",
|
||||
"gray": "",
|
||||
"dark_gray": "",
|
||||
"white": "",
|
||||
"reset": ""
|
||||
},
|
||||
"twentyFourBit":{
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
}
|
12
util/lang.js
12
util/lang.js
|
@ -1,16 +1,16 @@
|
|||
import { readdirSync } from "node:fs"
|
||||
import { readdirSync } from 'node:fs'
|
||||
import settings from '../settings.js'
|
||||
const languages = {}
|
||||
import { default as settings } from '../settings.js'
|
||||
const fallbackLocale = settings.fallbackLocale ? settings.fallbackLocale : 'en-US'
|
||||
|
||||
const loadplug = () => {
|
||||
const bpl = readdirSync('lang')
|
||||
for (const plugin of bpl) {
|
||||
if (!plugin.endsWith('.json')) {
|
||||
if (!plugin.endsWith('.js')) {
|
||||
continue
|
||||
}
|
||||
try {
|
||||
import(`../lang/${plugin}`, {with: {type: "json"}}).then(languageFile => {
|
||||
import(`../lang/${plugin}`).then(languageFile => {
|
||||
languages[plugin.split('.')[0]] = languageFile.default
|
||||
})
|
||||
} catch (e) { console.log(e) }
|
||||
|
@ -34,7 +34,7 @@ const getMessage = function (l, msg, with2) {
|
|||
return message.replace(/\ue123/g, '%').replace(/\ue124/g, '%s').replace(/\ue125/g, '$s')
|
||||
}
|
||||
|
||||
const languages_keys = Object.keys(languages)
|
||||
const languagesKeys = Object.keys(languages)
|
||||
const formatTime = function (time, language) {
|
||||
let finalString = ''
|
||||
const seconds = Math.floor(time / 1000) % 60
|
||||
|
@ -66,7 +66,7 @@ const formatTime = function (time, language) {
|
|||
}
|
||||
|
||||
export {
|
||||
languages_keys as languages,
|
||||
languagesKeys as languages,
|
||||
formatTime,
|
||||
getMessage
|
||||
}
|
|
@ -1,16 +1,15 @@
|
|||
export default function memoryconvert (bytes) {
|
||||
if (bytes >= 1125899906842624) { // Petabytes
|
||||
return `${Math.round(bytes / 1125899906842624 * 100) / 100} PB`
|
||||
} else if (bytes >= 1099511627776) { // Terabytes
|
||||
return `${Math.round(bytes / 1099511627776 * 100) / 100} TB`
|
||||
} else if (bytes >= 1073741824) { // Gigabytes
|
||||
return `${Math.round(bytes / 1073741824 * 100) / 100} GB`
|
||||
} else if (bytes >= 1048576) { // Megabytes
|
||||
return `${Math.round(bytes / 1048576 * 100) / 100} MB`
|
||||
} else if (bytes >= 1024) { // Kilobytes
|
||||
return `${Math.round(bytes / 1024 * 100) / 100} KB`
|
||||
} else { // Bytes
|
||||
return `${bytes} B`
|
||||
}
|
||||
if (bytes >= 1125899906842624) { // Petabytes
|
||||
return `${Math.round(bytes / 1125899906842624 * 100) / 100} PB`
|
||||
} else if (bytes >= 1099511627776) { // Terabytes
|
||||
return `${Math.round(bytes / 1099511627776 * 100) / 100} TB`
|
||||
} else if (bytes >= 1073741824) { // Gigabytes
|
||||
return `${Math.round(bytes / 1073741824 * 100) / 100} GB`
|
||||
} else if (bytes >= 1048576) { // Megabytes
|
||||
return `${Math.round(bytes / 1048576 * 100) / 100} MB`
|
||||
} else if (bytes >= 1024) { // Kilobytes
|
||||
return `${Math.round(bytes / 1024 * 100) / 100} KB`
|
||||
} else { // Bytes
|
||||
return `${bytes} B`
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { randomBytes } from "crypto";
|
||||
import { randomBytes } from 'crypto'
|
||||
const rsg = function (count) {
|
||||
let output = ''
|
||||
for (let i = 0; i < count; i++) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { default as version } from "../version.json" with { type: "json" }
|
||||
import { execSync } from "child_process"
|
||||
import version from '../version.js'
|
||||
import { execSync } from 'child_process'
|
||||
let botVersion = version.botVersion
|
||||
let gitCommit
|
||||
let gitBranch
|
||||
|
|
7
version.js
Normal file
7
version.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default {
|
||||
botName: 'botv12 Dev',
|
||||
botVersion: '12.0.0-alpha.1',
|
||||
botAuthor: 'owo439895035',
|
||||
isPreRelease: true,
|
||||
sourceURL: 'https://code.chipmunk.land/7cc5c4f330d47060/botv12'
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"botName": "botv12 Dev",
|
||||
"botVersion": "12.0.0-alpha.1",
|
||||
"botAuthor": "owo439895035",
|
||||
"isPreRelease": true,
|
||||
"sourceURL": "https://code.chipmunk.land/7cc5c4f330d47060/botv12"
|
||||
}
|
Loading…
Reference in a new issue