botv12/util/Command.js

29 lines
823 B
JavaScript
Raw Normal View History

2024-11-19 20:05:19 -05:00
import settings from '../settings.js'
2024-10-23 23:35:21 -04:00
export default class Command {
2024-11-20 01:34:57 -05:00
constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot) {
2024-11-19 20:05:19 -05:00
this.uuid = uuid
this.reply = text => bot.tellraw(uuid, text)
this.username = user
this.nickname = nick
this.command = cmd
this.type = senderType
this.msgType = msgType
this.msgSubtype = msgSubtype
this.args = cmd.split(' ').slice(1)
this.cmdName = cmd.split(' ')[0]
this.prefix = prefix
this.colors = settings.colors
this.lang = settings.defaultLang
2024-11-20 01:34:57 -05:00
this.verify = 0
2024-11-19 20:05:19 -05:00
this.host = bot.host.host
this.port = bot.host.port
this.bot = bot
2024-11-20 01:34:57 -05:00
this.rewriteCommand = newCmd => {
this.command = newCmd
this.args = newCmd.split(' ').slice(1)
this.cmdName = newCmd.split(' ')[0]
}
2024-11-19 20:05:19 -05:00
}
}