From 08a42ddd6939ad06a6917dc5eb4108b47eea23ba Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Sun, 13 Nov 2022 19:10:48 +0700 Subject: [PATCH] fix ansi color console thingy i saw hbot doing "/username HBot" so i noticed it and fixed this ploblem --- commands/eval.js | 2 +- plugins/console.js | 4 ++-- run.js | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/commands/eval.js b/commands/eval.js index e79d1f3..1cc835d 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -13,7 +13,7 @@ module.exports = { usage: [ ' ', '', - ' code', + ' ', ], execute: function(bot, username, usernameraw, sender, prefix, args, config) { if (args[0] === 'run') { diff --git a/plugins/console.js b/plugins/console.js index 2c36442..ec75f74 100644 --- a/plugins/console.js +++ b/plugins/console.js @@ -9,9 +9,9 @@ function inject(bot, dcclient, config, rl) { const chatMessage = require('prismarine-chat')(bot.version); function prefix(prefix, _message) { - const message = `[${moment().format('HH:mm:ss')} ${prefix}§r] [${bot.options.host}] ${_message}`; + const message = `[${moment().format('HH:mm:ss')} ${prefix}§r] [${bot.options.host}] `; const component = chatMessage.MessageBuilder.fromString(message).toJSON(); - return chatMessage.fromNotch(component).toAnsi(); + return chatMessage.fromNotch(component).toAnsi() + _message; } bot.console = {}; diff --git a/run.js b/run.js index 37f2e63..b0e2f78 100644 --- a/run.js +++ b/run.js @@ -1,5 +1,4 @@ /* eslint-disable max-len */ -/* eslint-disable no-var */ const readline = require('node:readline'); const {stdin: input, stdout: output} = require('node:process'); const rl = readline.createInterface({input, output});