2024-04-02 17:53:10 -04:00
|
|
|
const { literal, argument, greedyString } = require('brigadier-commands')
|
2024-02-11 21:23:41 -05:00
|
|
|
|
2024-04-02 17:53:10 -04:00
|
|
|
module.exports = {
|
|
|
|
register (dispatcher) {
|
|
|
|
const node = dispatcher.register(
|
|
|
|
literal('netmsg')
|
|
|
|
.then(
|
|
|
|
argument('message', greedyString())
|
2024-07-31 22:34:19 -04:00
|
|
|
.executes(c => this.netMsgCommand(c))
|
2024-04-02 17:53:10 -04:00
|
|
|
)
|
|
|
|
)
|
2024-02-11 21:23:41 -05:00
|
|
|
|
2024-04-02 17:53:10 -04:00
|
|
|
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')
|
2024-02-11 21:23:41 -05:00
|
|
|
|
2024-04-02 17:53:10 -04:00
|
|
|
const host = bot.host
|
|
|
|
bot.bots.forEach((bot) => bot.fancyMsg(host, source.displayName, message))
|
|
|
|
}
|
|
|
|
}
|