chipmunkbot3/commands/cb.js
2024-07-31 22:34:19 -04:00

21 lines
513 B
JavaScript

const { literal, argument, greedyString } = require('brigadier-commands')
module.exports = {
register (dispatcher) {
const node = dispatcher.register(
literal('cb')
.then(
argument('command', greedyString())
.executes(c => this.runCommand(c))
)
)
node.description = 'Runs a command in the command core'
node.permissionLevel = 0
},
runCommand (context) {
const bot = context.source.bot
bot.core.run(context.getArgument('command'))
}
}