irc colors

This commit is contained in:
Flummi 2018-09-02 17:44:00 +02:00
parent 04f4f36a5e
commit 34ea115260

View File

@ -8,10 +8,10 @@ import tls from "tls";
import EventEmitter from "events";
const colors = {
red: "\x0304$1\x0304",
blue: "\x0312$1\x0312",
yellow: "\x0308$1\x0308",
green: "\x0303$1\x0303"
red: "04",
blue: "12",
yellow: "08",
green: "03" // \x0F
};
const msgmodes = {
normal: "PRIVMSG {recipient} :{msg}",
@ -21,7 +21,7 @@ const msgmodes = {
const replaceColor = (match, color, text) => {
if (colors.hasOwnProperty(color))
return colors[color].replace("\$1", text);
return `\x03${colors[color]}${text}\x0F`;
return text;
};