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