owobot/util/ConsoleCommand.js

32 lines
1 KiB
JavaScript
Raw Normal View History

2024-07-30 05:56:23 -04:00
// HOW TO WRITE CLASS JS
const index = require('../index.js')
2024-08-03 03:00:04 -04:00
const cmds = require('./commands.js')
2024-08-01 20:11:59 -04:00
const parse = require('../util/chatparse_console.js')
2024-07-30 05:56:23 -04:00
const settings = require('../settings.json')
const {getMessage} = require('../util/lang.js')
const lang = settings.defaultLang
class ConsoleCommand {
constructor (cmd, index2) {
this.send = () => {} // not needed for console
2024-08-01 20:11:59 -04:00
this.reply = text => process.stdout.write(parse(text) + '\n')
2024-07-30 05:56:23 -04:00
this.uuid = 'dde5a2a6-ebdd-4bbb-8eac-f75b10c10446_console' // hard-coded because uuid does not exist at console
this.username = 'Owner'
this.nickname = 'Console'
this.command = cmd
this.prefix = '' // prefix does not exist at console
this.bot = index2 >= 0
? index.bot[index2]
: {}
2024-07-30 05:56:23 -04:00
this.type = 'console'
this.index = index2
this.args = cmd.split(' ').slice(1)
this.verify = 3
this.host = ''
this.port = '3' // :3
this.lang = settings.defaultLang
this.colors = settings.colors
}
}
module.exports = ConsoleCommand