25 lines
657 B
JavaScript
Executable file
25 lines
657 B
JavaScript
Executable file
const { literal, argument, greedyString } = require('brigadier-commands')
|
|
|
|
module.exports = {
|
|
register (dispatcher) {
|
|
const node = dispatcher.register(
|
|
literal('netmsg')
|
|
.then(
|
|
argument('message', greedyString())
|
|
.executes(c => this.netMsgCommand(c))
|
|
)
|
|
)
|
|
|
|
node.description = 'Runs a command in the command core'
|
|
node.permissionLevel = 0
|
|
},
|
|
|
|
netMsgCommand (context) {
|
|
const source = context.source
|
|
const bot = source.bot
|
|
const message = context.getArgument('message')
|
|
|
|
const host = bot.host
|
|
bot.bots.forEach((bot) => bot.fancyMsg(host, source.displayName, message))
|
|
}
|
|
}
|