DiscordSRV

DiscordSRV

86.8k Downloads

Add the functionality to recognize RGB colors similar to "normal" colors in prefix

LaurenceBarnes opened this issue · 4 comments

commented

Hey, we use prefix names for the role names that transfer to discord, and it works perfectly fine. For our custom needs this is a better solution than using the group name. When we have the prefix like

prefix.300.&r[&BTest&r]

The color code is ignored properly and there is just "[Test]" in the discord chat. However, when I want to use RGB colors which are supported by LuckPerms, like

prefix.300.&r[&#74C8F5Test&r]

it displays [&#74C8F5Test] in the chat while working perfectly in-game. It would be really great if DiscordSRV could recognize RGB colors as well, probably the "#" in combination with the "&" could be the "key" sign to ignore the following six digits :D

Thanks!

PS.: if I should add any info to this, tell me of course xD

commented

RGB colors which are supported by LuckPerms

This isn't actually true, LuckPerms doesn't handle color codes at all; it merely stores them as prefixes/suffixes for chat plugins to handle.

You can use DiscordChatChannelGameFilters to ignore these, eg. "&#[a-fA-F0-9]{6}": "" - though support for stripping this format by default may be added in the future as well

commented

yeah I see, but you got what I meant xD

How exactly would I add to those filters in this case?

DiscordChatChannelGameFilters: {}
DiscordChatChannelDiscordFilters: {".*Online players\\(.*": "", ".*\\*\\*No online players\\*\\*.*": ""}

is there by default

commented
DiscordChatChannelGameFilters: {"&#[a-fA-F0-9]{6}": ""}
commented

that worked, thanks so much!