misc.mcserver: fix motd coloring
This commit is contained in:
parent
fcb1b770ea
commit
3bebfa762f
1 changed files with 1 additions and 1 deletions
|
@ -243,7 +243,7 @@ mcserver.callback = async function (msg, line) {
|
||||||
typeof data.description == "string"
|
typeof data.description == "string"
|
||||||
? data.description
|
? data.description
|
||||||
: data.description?.text ?? "<server didn't properly send motd>";
|
: data.description?.text ?? "<server didn't properly send motd>";
|
||||||
const motd = desc.replace(/\u00a7([a-f0-9k-or])/gi, (formatting) => {
|
const motd = desc.replace(/\u00a7([a-f0-9k-or])/gi, (_, formatting) => {
|
||||||
const ansi = formattingToAnsi[formatting];
|
const ansi = formattingToAnsi[formatting];
|
||||||
return ansi ? `\x1b[${ansi}m` : "";
|
return ansi ? `\x1b[${ansi}m` : "";
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue