irc colors
This commit is contained in:
parent
04f4f36a5e
commit
34ea115260
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user