Class Markdown
java.lang.Object
com.github.alex1304.ultimategdbot.api.utils.Markdown
public class Markdown extends Object
-
Method Summary
Modifier and Type Method Description static Stringbold(String text)Formats the text with bold markdownstatic Stringcode(String text)Formats the text as code.static StringcodeBlock(String text)Formats the text as a code block.static StringcodeBlock(String text, String language)Formats the text as a code block.static Stringescape(String text)Escapes characters used in Markdown syntax using a backslashstatic Stringitalic(String text)Formats the text with italic markdown.static Stringitalic(String text, boolean starVariant)Formats the text with italic markdownstatic StringmaskedLink(String clickableText, String url)Make a masked link using markdown.static Stringquote(String text)Formats the text as a quote.static Stringspoiler(String text)Formats the text with spoiler markdown.static Stringstrikethrough(String text)Formats the text with strikethrough markdown.static Stringunderline(String text)Formats the text with underline markdown.
-
Method Details
-
escape
Escapes characters used in Markdown syntax using a backslash- Parameters:
text- the Markdown text to escape- Returns:
- String
-
bold
Formats the text with bold markdown- Parameters:
text- the text to format- Returns:
- the formatted text
-
italic
Formats the text with italic markdown- Parameters:
text- the text to formatstarVariant- whether to use stars (*) or underscores (_) to make italic- Returns:
- the formatted text
-
italic
Formats the text with italic markdown. Uses the star variant by default.- Parameters:
text- the text to format- Returns:
- the formatted text
- See Also:
italic(String, boolean)
-
underline
Formats the text with underline markdown.- Parameters:
text- the text to format- Returns:
- the formatted text
-
strikethrough
Formats the text with strikethrough markdown.- Parameters:
text- the text to format- Returns:
- the formatted text
-
spoiler
Formats the text with spoiler markdown.- Parameters:
text- the text to format- Returns:
- the formatted text
-
maskedLink
Make a masked link using markdown. Note that this only works in Discord embed fields and descriptions, not in regular messages.- Parameters:
clickableText- the text that should be clickableurl- the url to redirect to when the text is clicked- Returns:
- the masked link markdown
-
code
Formats the text as code.- Parameters:
text- the text to format- Returns:
- the formatted text
-
codeBlock
Formats the text as a code block.- Parameters:
text- the text to formatlanguage- the language of the code (hint for syntax highlighting)- Returns:
- the formatted text
-
codeBlock
Formats the text as a code block. This overload does not specify a language parameter for syntax highlighting.- Parameters:
text- the text to format- Returns:
- the formatted text
-
quote
Formats the text as a quote.- Parameters:
text- the text to format- Returns:
- the formatted text
-