chomens-bot-js/commands/netmsg.js

48 lines
1 KiB
JavaScript
Raw Normal View History

2022-11-14 07:53:44 -05:00
/* eslint-disable max-len */
module.exports = {
name: 'netmsg',
alias: ['networkmessage', 'irc'],
description: 'Broadcasts a message to all of the servers that the bot is connected',
usage: '<message>',
trusted: 0,
2022-11-27 02:35:28 -05:00
execute: function (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
2022-11-14 07:53:44 -05:00
const component = [
{
text: '[',
2022-11-27 02:35:28 -05:00
color: 'dark_gray'
2022-11-14 07:53:44 -05:00
},
{
text: bot.options.host === 'kitsune.icu' ? 'kit' : bot.options.host,
2022-11-27 02:35:28 -05:00
color: 'gray'
2022-11-14 07:53:44 -05:00
},
2022-11-27 02:35:28 -05:00
bot.options.host === 'kitsune.icu'
? {
text: 'sune.icu',
color: 'gray'
}
: '',
2022-11-14 07:53:44 -05:00
{
text: '] ',
2022-11-27 02:35:28 -05:00
color: 'dark_gray'
2022-11-14 07:53:44 -05:00
},
{
text: username,
2022-11-27 02:35:28 -05:00
color: 'gray'
2022-11-14 07:53:44 -05:00
},
{
text: ' \u203a ',
2022-11-27 02:35:28 -05:00
color: 'dark_gray'
2022-11-14 07:53:44 -05:00
},
{
text: args.join(' '),
2022-11-27 02:35:28 -05:00
color: 'gray'
}
]
2022-11-14 07:53:44 -05:00
2022-11-27 02:35:28 -05:00
const bots = bot.getBots()
2022-11-14 07:53:44 -05:00
bots.forEach((bot) => {
2022-11-27 02:35:28 -05:00
bot.tellraw(selector, component)
})
}
}