add the prefix to the config

This commit is contained in:
1e99 2025-07-21 21:03:55 +02:00
parent b8db1b7c94
commit 022d624315
2 changed files with 5 additions and 4 deletions

View file

@ -7,5 +7,6 @@
"auth": "microsoft",
"username": "Notch"
},
"database": "./data.sqlite"
"database": "./data.sqlite",
"prefix": "!"
}

View file

@ -39,7 +39,7 @@ try {
process.exit(1)
}
const db = new sqlite.DatabaseSync(config.database)
const db = new sqlite.DatabaseSync(config["database"])
migrateDB(db)
const reconnectDelay = 10_000
@ -56,7 +56,7 @@ function newClient() {
console.log("Client connecting")
// Client
const client = mcProtocol.createClient(config.minecraft)
const client = mcProtocol.createClient(config["minecraft"])
client.addListener("connect", () => {
console.log("Client connected")
@ -91,7 +91,7 @@ function newClient() {
new PlayerTracker(client, players, db)
// Commands
const commands = new Commands(chat, "!")
const commands = new Commands(chat, config["prefix"])
commands.register(new BestPingCommand(chat, players))
commands.register(new HelpCommand(chat, commands))
commands.register(new InfoCommand(chat))