kord icon indicating copy to clipboard operation
kord copied to clipboard

Add contentDisplay and contentStripped to Message

Open DRSchlaubi opened this issue 3 years ago • 8 comments

JDA has this functionality, and it has been requested

DRSchlaubi avatar Feb 05 '22 04:02 DRSchlaubi

Right now I can think a few things that could be probelmatic with this implementation:

  • Message.contentDisplay() will always replace mentions etc. even if they are escaped by \ or inside a code block
  • Messge.contentDisplay() does not handle spoiler tags or timestamps
  • String.parseMarkdown() will not recognize spoiler tags, mentions etc. and therefore cannot escape or strip them (tough I'm not sure if it would be desired behavior)

lukellmann avatar Feb 06 '22 04:02 lukellmann

Message.contentDisplay() will always replace mentions etc. even if they are escaped by \ or inside a code block

Are you sure that those mentions will appear in message.mentionedUsers if they're escaped?

DRSchlaubi avatar Feb 06 '22 15:02 DRSchlaubi

Message.contentDisplay() will always replace mentions etc. even if they are escaped by \ or inside a code block

Are you sure that those mentions will appear in message.mentionedUsers if they're escaped?

Oh, you've got a point there, didn't think about that. Probably not. But it still seems to be a problem with emotes.

lukellmann avatar Feb 06 '22 15:02 lukellmann

Problem with spoilers is, that | isn't a valid markdown token and changing the lexer is hard outside the markdown parser itself

DRSchlaubi avatar Feb 06 '22 15:02 DRSchlaubi

I still can't figure out if this should be in the library or could be some sort of separate thing

HopeBaron avatar Mar 23 '22 08:03 HopeBaron

JDA had a similar utility and we cannot make it a lazy property of Message from another module

DRSchlaubi avatar Mar 23 '22 15:03 DRSchlaubi

./gradlew apiDump is missing :)

lukellmann avatar Feb 16 '23 13:02 lukellmann

./gradlew apiDump is missing :)

Dang keep forgetting that :)

DRSchlaubi avatar Feb 16 '23 14:02 DRSchlaubi