-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add contentDisplay and contentStripped to Message #521
base: main
Are you sure you want to change the base?
Conversation
4a417e9
to
e736d1a
Compare
* - Roles to their @RoleName format | ||
* - Emotes (not emojis!) to their :name: format. | ||
*/ | ||
public suspend fun contentDisplay(): String = contentDisplay.await() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about timestamps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timestamps don't really make sense because they depend on a specific user's time and don't look the same for all users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, aware of that, just thought I would point this out, even though I can't come up with a solution.
import kotlin.test.assertEquals | ||
|
||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | ||
class MarkdownEscapeTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also add a test for strikethrough, bold, bold italics and multiline block quotes? https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-
import kotlin.test.assertEquals | ||
|
||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | ||
class MarkdownStripTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for MarkdownEscapeTest
: maybe also tests for bold etc.
Right now I can think a few things that could be probelmatic with this implementation:
|
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. |
Problem with spoilers is, that |
I still can't figure out if this should be in the library or could be some sort of separate thing |
JDA had a similar utility and we cannot make it a lazy property of Message from another module |
a1bb076
to
1e6718a
Compare
e736d1a
to
17bf3b0
Compare
@@ -70,6 +70,7 @@ atomicfu-plugin = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", ver | |||
binary-compatibility-validator-plugin = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "binary-compatibility-validator" } | |||
ksp-plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" } | |||
|
|||
markdown = { group = "org.jetbrains", name = "markdown", version = "0.2.4" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be under the other
section? it's not a plugin, right?
|
Dang keep forgetting that :) |
JDA has this functionality, and it has been requested