hypherionmc / sdlink

A simple to use Minecraft to Discord Chat linker with Whitelisting
MIT License
21 stars 7 forks source link

Formatting codes come through for team prefixes and /say command #53

Closed R6219 closed 10 months ago

R6219 commented 1 year ago

If a vanilla team has been assigned a prefix with a color (using /team modify prefix ), the formatting codes (section sign § characters and their following assignment) get transmitted to Discord. The player below belongs to the [OP] team:

image

And here's how their name comes through on the Discord channel:

image image

Additionally, these codes come through when using the /say command.

Using fabric/quilt release 1.19.3-2.2.1.

hypherionmc commented 1 year ago

I'm guessing the /team command is from a mod.

If that is the case, we do not officially support any mods that add prefixes or colors to usernames, because they end up using weird formatting code like that.

It's something we're looking at improving with the v3 release, since we are rewriting the entire mod

R6219 commented 1 year ago

The /team command is a vanilla feature commonly used on servers, and often in datapacks: https://minecraft.fandom.com/wiki/Commands/team

hypherionmc commented 1 year ago

Interesting. Didn't even know about that command... TIL

Will take a look into it. Thanks for reporting

hypherionmc commented 1 year ago

So far, this issue has been revolved with the V3 development. Did some basic testing, and the codes appear to be stripped now. If you want, you can send me the formatting for the issue you reported, so I can confirm that it properly strips the codes

R6219 commented 1 year ago

Glad to hear it! Thanks for taking this on. The particular formatting in the reported issue can be replicated in-game using these commands:

/team add op.team

/team modify op.team prefix "\u00A78[\u00A7d\u00A7k_\u00A7r\u00A76OP\u00A7d\u00A7k_\u00A7r\u00A78]"

/team join op.team @s

This creates a team "op.team", changes its prefix to the formatted json text in the quotes, and joins the player who sends the command to the team. Messages typed in chat by the team member should then display the prefix next to the name.

R6219 commented 1 year ago

Would you mind testing for formatting codes in other places, such as a with /say message? For example, would say §dhi (sent from the server console) also strip the formatting code in the Discord message?

hypherionmc commented 1 year ago

I will test with both. Once V3 is stable enough to be used, would you mind being a beta tester? I want the V3 release to go out without any bugs (or atleast little to no bugs)

R6219 commented 1 year ago

I'd be happy to! How do I do that?

hypherionmc commented 1 year ago

We provide the builds on our Jenkins server, but there aren't any available yet. As soon as there is a build available, I will give you a shout. If you are in our Discord Server, you should receive the ping as well

hypherionmc commented 1 year ago

Since I finally have time to work on V3 again, I can now confirm this issue is fixed in V3.

Top one is the say command, bottom one is normal chat, with team assigned

Image

hypherionmc commented 10 months ago

Implemented in V3 beta