2024-07-28 02:37:31 -04:00
|
|
|
const settings = require('../settings.json')
|
|
|
|
class Command {
|
2024-08-22 07:34:39 -04:00
|
|
|
constructor (uuid, user, nick, cmd, msgType, prefix, bot, verify, prefs) {
|
2024-07-28 02:37:31 -04:00
|
|
|
this.send = (text, uuid) => { bot.tellraw(uuid || '@a', text) }
|
|
|
|
this.reply = text => bot.tellraw(uuid, text)
|
|
|
|
this.uuid = uuid
|
|
|
|
this.username = user
|
|
|
|
this.nickname = nick
|
|
|
|
this.command = cmd
|
2024-08-22 07:34:39 -04:00
|
|
|
this.msgType = msgType
|
2024-07-28 02:37:31 -04:00
|
|
|
this.prefix = prefix
|
|
|
|
this.bot = bot
|
|
|
|
this.type = 'minecraft'
|
|
|
|
this.args = cmd.split(' ').slice(1)
|
2024-08-23 10:29:01 -04:00
|
|
|
this.cmdName = cmd.split(' ')[0]
|
2024-07-28 02:37:31 -04:00
|
|
|
this.verify = verify
|
|
|
|
this.host = bot.host.host
|
|
|
|
this.port = bot.host.port
|
2024-08-24 09:06:55 -04:00
|
|
|
this.serverName = bot.host.options.name
|
2024-08-12 05:13:32 -04:00
|
|
|
this.prefs = prefs
|
2024-08-22 07:34:39 -04:00
|
|
|
if (prefs.lang) {
|
2024-08-12 05:13:32 -04:00
|
|
|
this.lang = prefs.lang
|
|
|
|
} else {
|
|
|
|
this.lang = settings.defaultLang
|
|
|
|
}
|
2024-08-22 07:34:39 -04:00
|
|
|
|
|
|
|
const _colors = {}
|
|
|
|
if (prefs.colorPrimary) {
|
2024-08-12 05:13:32 -04:00
|
|
|
_colors.primary = prefs.colorPrimary
|
|
|
|
} else {
|
|
|
|
_colors.primary = settings.colors.primary
|
|
|
|
}
|
2024-08-22 07:34:39 -04:00
|
|
|
if (prefs.colorSecondary) {
|
2024-08-12 05:13:32 -04:00
|
|
|
_colors.secondary = prefs.colorSecondary
|
|
|
|
} else {
|
|
|
|
_colors.secondary = settings.colors.secondary
|
|
|
|
}
|
|
|
|
this.colors = _colors
|
2024-07-28 02:37:31 -04:00
|
|
|
}
|
2024-07-27 02:39:18 -04:00
|
|
|
}
|
|
|
|
|
2024-07-28 02:37:31 -04:00
|
|
|
module.exports = Command
|