Rename the settings file to JS

This commit is contained in:
7cc5c4f330d47060 2024-11-19 19:47:14 -05:00
parent 9f789fccb1
commit e87b2bbe2b
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
15 changed files with 52 additions and 44 deletions

5
.gitignore vendored
View file

@ -151,11 +151,12 @@ dist
# Bot Settings
settings.json
settings.js
# Default secret file
# Legacy secret file for version 10
secret.json
# botvX user settings
# botvX / owobot user settings
userPref/
# botvX log files

View file

@ -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" }
const execute = (c) => {
if (c.verify < 1) {

View file

@ -1,5 +1,5 @@
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 EventEmitter from 'node:events'
import { readdirSync } from "node:fs";

View file

@ -1,6 +1,6 @@
import chatlog from '../util/chatlog.js'
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 = () => {
if (settings.disableLogging) return

View file

@ -1,5 +1,5 @@
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'
export default function load (b) {
b.on('chat', (data) => {

View file

@ -1,5 +1,5 @@
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 { bots } from "../index.js"
import Command from '../util/Command.js'

View file

@ -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 { bots } from "../index.js"
import botVersion from "../util/version.js"

View file

@ -1,6 +1,6 @@
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.json' with {type: "json"}
import { default as settings } from '../settings.js'
import { default as version } from '../version.json' with {type: "json"}
class SCTask {
constructor (failTask, startFailed = false) {

View file

@ -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 parseConsole } from '../util/chatparse_console.js'
import { default as parse1204 } from '../util/parseNBT.js'

37
settings_example.js Normal file
View 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"
}
}
]
}

View file

@ -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"
}
}
]
}

View file

@ -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 {
constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot, verify) {
this.uuid=uuid;

View file

@ -1,5 +1,5 @@
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) {
if (settings.disableLogging) return

View file

@ -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 { default as _consoleColors } from './consolecolors.json' with {type: "json"}

View file

@ -1,6 +1,6 @@
import { readdirSync } from "node:fs"
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 loadplug = () => {