Minecord (for Discord)

Minecord (for Discord)

570k Downloads

Markdown formatting in Discord is lost when using Styled Chat mod

nycki93 opened this issue ยท 2 comments

commented

Expected behavior

Chat which appears italic/bold in minecraft should also appear italic/bold in discord.

Observed/actual behavior

When styledchat is set to parse markdown, chat in the minecraft -> minecraft direction can have italics and bold, but chat in the minecraft -> discord direction does not.

When styledchat is NOT set to parse markdown, chat in the minecraft -> discord direction can have italics and bold, but chat in the minecraft -> minecraft direction does not.

Steps/models to reproduce

install minecord and styled-chat. in styled-chat.json, set "markdown": true.

from minecraft, type:

*italics* and **bold**

in minecraft, this displays as

<~nycki> italics and bold

in discord, you should see

Overworld ~nycki > italics and bold

Version

minecraft 1.20.2
openjdk 17.0.9
fabric api 0.91.1
minecord 2.0.2
styled-chat 2.3.0
styled-nicknames 1.3.0

Agreements

  • I am running the latest version of the mod.
  • My version of Minecraft is supported.
  • I have searched for and ensured there isn't already an open issue regarding this.

Other

No response

commented

This will require a full featured Minecraft's Text to markdown string converter.

commented

Good pickup, thanks. I believe these old lines of code are to blame from before we moved to Text Placeholder API -

final PlaceholderContext ctx = PlaceholderContext.of(player);
final Map<String, PlaceholderHandler> placeholders = Map.of(
// The formatted message contents
"message", string(StringUtils.minecraftToDiscord(message.getContent().getString()))
);

I wonder if MarkdownLiteParserV1 from Text Placeholder API could be used here instead.