mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
fix/improve console
This commit is contained in:
parent
a40c8a0cd5
commit
65feec46da
1 changed files with 0 additions and 20 deletions
|
@ -1,7 +1,4 @@
|
|||
/* eslint-disable no-eval */
|
||||
|
||||
const moment = require('moment-timezone')
|
||||
const util = require('util')
|
||||
|
||||
function inject (bot, _dcclient, config, rl) {
|
||||
// readline > fix on log
|
||||
|
@ -55,27 +52,10 @@ function inject (bot, _dcclient, config, rl) {
|
|||
}
|
||||
|
||||
if (bot.options.host !== bot.console.host && bot.console.host !== 'all') return
|
||||
if (line.toLowerCase() === '.exit' || line.toLowerCase() === '.end') {
|
||||
bot.end('end command')
|
||||
return
|
||||
}
|
||||
if (line.toLowerCase().startsWith('.servereval ')) {
|
||||
try {
|
||||
bot.tellraw('@a', {
|
||||
text: `${util.inspect(eval(`${line.substring(12)}`))}`,
|
||||
color: 'green'
|
||||
})
|
||||
return
|
||||
} catch (err) {
|
||||
bot.tellraw('@a', { text: `${util.inspect(err)}`, color: 'red' })
|
||||
return
|
||||
}
|
||||
}
|
||||
if (line === '.kill') process.exit()
|
||||
|
||||
if (line.startsWith('.')) {
|
||||
return bot.command_handler.run(
|
||||
bot.username,
|
||||
bot.username,
|
||||
'*' + line.substring(1),
|
||||
bot.uuid,
|
||||
|
|
Loading…
Reference in a new issue