forked from 7cc5c4f330d47060/botv12
Rename the settings file to JS
This commit is contained in:
parent
9f789fccb1
commit
e87b2bbe2b
15 changed files with 52 additions and 44 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -151,11 +151,12 @@ dist
|
||||||
|
|
||||||
# Bot Settings
|
# Bot Settings
|
||||||
settings.json
|
settings.json
|
||||||
|
settings.js
|
||||||
|
|
||||||
# Default secret file
|
# Legacy secret file for version 10
|
||||||
secret.json
|
secret.json
|
||||||
|
|
||||||
# botvX user settings
|
# botvX / owobot user settings
|
||||||
userPref/
|
userPref/
|
||||||
|
|
||||||
# botvX log files
|
# botvX log files
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
import { default as version } from "../version.json" with { type: "json" }
|
import { default as version } from "../version.json" with { type: "json" }
|
||||||
const execute = (c) => {
|
const execute = (c) => {
|
||||||
if (c.verify < 1) {
|
if (c.verify < 1) {
|
||||||
|
|
2
index.js
2
index.js
|
@ -1,5 +1,5 @@
|
||||||
import { createClient } from "minecraft-protocol";
|
import { createClient } from "minecraft-protocol";
|
||||||
import { default as settings } from './settings.json' with {type: "json"}
|
import { default as settings } from './settings.js'
|
||||||
import generateUser from './util/usergen.js'
|
import generateUser from './util/usergen.js'
|
||||||
import EventEmitter from 'node:events'
|
import EventEmitter from 'node:events'
|
||||||
import { readdirSync } from "node:fs";
|
import { readdirSync } from "node:fs";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import chatlog from '../util/chatlog.js'
|
import chatlog from '../util/chatlog.js'
|
||||||
import { readdirSync, mkdirSync } from "node:fs"
|
import { readdirSync, mkdirSync } from "node:fs"
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
|
|
||||||
const checkLog = () => {
|
const checkLog = () => {
|
||||||
if (settings.disableLogging) return
|
if (settings.disableLogging) return
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import cmds from "../util/commands.js"
|
import cmds from "../util/commands.js"
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
import Command from '../util/Command.js'
|
import Command from '../util/Command.js'
|
||||||
export default function load (b) {
|
export default function load (b) {
|
||||||
b.on('chat', (data) => {
|
b.on('chat', (data) => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { createInterface, cursorTo, clearLine } from "node:readline"
|
import { createInterface, cursorTo, clearLine } from "node:readline"
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
import cmds from "../util/commands.js"
|
import cmds from "../util/commands.js"
|
||||||
import { bots } from "../index.js"
|
import { bots } from "../index.js"
|
||||||
import Command from '../util/Command.js'
|
import Command from '../util/Command.js'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
import { default as version } from '../version.json' with {type: "json"}
|
import { default as version } from '../version.json' with {type: "json"}
|
||||||
import { bots } from "../index.js"
|
import { bots } from "../index.js"
|
||||||
import botVersion from "../util/version.js"
|
import botVersion from "../util/version.js"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||||
import { default as parseMc } from '../util/chatparse_mc_withHex.js'
|
import { default as parseMc } from '../util/chatparse_mc_withHex.js'
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
import { default as version } from '../version.json' with {type: "json"}
|
import { default as version } from '../version.json' with {type: "json"}
|
||||||
class SCTask {
|
class SCTask {
|
||||||
constructor (failTask, startFailed = false) {
|
constructor (failTask, startFailed = false) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
import { default as parsePlain } from '../util/chatparse_plain.js'
|
import { default as parsePlain } from '../util/chatparse_plain.js'
|
||||||
import { default as parseConsole } from '../util/chatparse_console.js'
|
import { default as parseConsole } from '../util/chatparse_console.js'
|
||||||
import { default as parse1204 } from '../util/parseNBT.js'
|
import { default as parse1204 } from '../util/parseNBT.js'
|
||||||
|
|
37
settings_example.js
Normal file
37
settings_example.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
|
||||||
|
"host": "chipmunk.land",
|
||||||
|
"port": 25565,
|
||||||
|
"options": {
|
||||||
|
"name": "chipmunk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
"version_mc": "1.20.4",
|
|
||||||
"terminalMode": "blackTerminal_24bit",
|
|
||||||
"colors": {
|
|
||||||
"primary": "#ffccee",
|
|
||||||
"secondary": "#ff99dd"
|
|
||||||
},
|
|
||||||
"prefixes": [
|
|
||||||
"d\"",
|
|
||||||
"ubotdev:",
|
|
||||||
"owobotdev:"
|
|
||||||
],
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"host": "kaboom.pw",
|
|
||||||
"port": 25565,
|
|
||||||
"options": {
|
|
||||||
"name": "kaboom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
|
|
||||||
"host": "chipmunk.land",
|
|
||||||
"port": 25565,
|
|
||||||
"options": {
|
|
||||||
"name": "chipmunk"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
export default class Command {
|
export default class Command {
|
||||||
constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot, verify) {
|
constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot, verify) {
|
||||||
this.uuid=uuid;
|
this.uuid=uuid;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { appendFileSync } from 'node:fs'
|
import { appendFileSync } from 'node:fs'
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
|
|
||||||
export default function chatlog (fileName, item) {
|
export default function chatlog (fileName, item) {
|
||||||
if (settings.disableLogging) return
|
if (settings.disableLogging) return
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
import lang from './mc_lang.js'
|
import lang from './mc_lang.js'
|
||||||
import { default as _consoleColors } from './consolecolors.json' with {type: "json"}
|
import { default as _consoleColors } from './consolecolors.json' with {type: "json"}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { readdirSync } from "node:fs"
|
import { readdirSync } from "node:fs"
|
||||||
const languages = {}
|
const languages = {}
|
||||||
import { default as settings } from '../settings.json' with {type: "json"}
|
import { default as settings } from '../settings.js'
|
||||||
const fallbackLocale = settings.fallbackLocale ? settings.fallbackLocale : 'en-US'
|
const fallbackLocale = settings.fallbackLocale ? settings.fallbackLocale : 'en-US'
|
||||||
|
|
||||||
const loadplug = () => {
|
const loadplug = () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue