chipmunkbot3/commands/csvr.js

26 lines
584 B
JavaScript
Raw Normal View History

2024-04-02 17:53:10 -04:00
const { literal, argument, greedyString } = require('brigadier-commands')
module.exports = {
register (dispatcher) {
const node = dispatcher.register(
literal('csvr')
.then(
argument('host', greedyString())
.executes(this.consoleServerCommand)
)
)
node.description = 'Sets the console server'
node.permissionLevel = 0
},
consoleServerCommand (context) {
const bot = context.source.bot
const host = context.getArgument('host')
for (const other of bot.bots) {
other.console.host = host
}
}
}