25 lines
592 B
JavaScript
25 lines
592 B
JavaScript
const { literal, argument, greedyString } = require('brigadier-commands')
|
|
|
|
module.exports = {
|
|
register (dispatcher) {
|
|
const node = dispatcher.register(
|
|
literal('csvr')
|
|
.then(
|
|
argument('host', greedyString())
|
|
.executes(c => this.consoleServerCommand(c))
|
|
)
|
|
)
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|