chipmunkbot3/commands/reload.js

21 lines
494 B
JavaScript

const { literal } = require('brigadier-commands')
module.exports = {
register (dispatcher) {
const node = dispatcher.register(
literal('reload')
.executes(this.reloadCommand)
)
node.description = 'Attempts to reload all commands'
node.permissionLevel = 0
},
reloadCommand (context) {
const source = context.source
const bot = source.bot
source.sendFeedback({ text: 'Reloading!', ...bot.styles.primary }, true)
bot.commands.reload()
}
}