janispritzkau / rcon-client

A simple and modern RCON client made to work with Minecraft
64 stars 17 forks source link

A way to filter color codes away from in-game command responses #10

Closed HeavenCrafter closed 4 years ago

HeavenCrafter commented 4 years ago

I'm currently building an RCON function onto my Discord.js bot but only one issue with that is, color codes just look like normal text which can be an eyesore sometimes. Even console responses can look quite annoying at times as well so was kinda wondering, any possible way around this?

HeavenCrafter commented 4 years ago

Reference image image

janispritzkau commented 4 years ago

It's not something I would implement into this library. But a simple regular expression should do the trick: text.replace(/§./g, "")