Class Format
- Namespace
- Discord
- Assembly
- Discord.Net.Core.dll
A helper class for formatting characters.
public static class Format
- Inheritance
-
Format
- Inherited Members
Methods
BlockQuote(string)
Formats a string as a block quote.
public static string BlockQuote(string text)
Parameters
text
stringThe text to format.
Returns
- string
Gets the formatted block quote text.
Bold(string)
Returns a markdown-formatted string with bold formatting.
public static string Bold(string text)
Parameters
text
string
Returns
Code(string, string)
Returns a markdown-formatted string with codeblock formatting.
public static string Code(string text, string language = null)
Parameters
Returns
EscapeUrl(string)
Escapes a URL so that a preview is not generated.
public static string EscapeUrl(string url)
Parameters
url
string
Returns
Italics(string)
Returns a markdown-formatted string with italics formatting.
public static string Italics(string text)
Parameters
text
string
Returns
Quote(string)
Formats a string as a quote.
public static string Quote(string text)
Parameters
text
stringThe text to format.
Returns
- string
Gets the formatted quote text.
Sanitize(string)
Sanitizes the string, safely escaping any Markdown sequences.
public static string Sanitize(string text)
Parameters
text
string
Returns
Spoiler(string)
Returns a string with spoiler formatting.
public static string Spoiler(string text)
Parameters
text
string
Returns
Strikethrough(string)
Returns a markdown-formatted string with strike-through formatting.
public static string Strikethrough(string text)
Parameters
text
string
Returns
StripMarkDown(string)
Remove discord supported markdown from text.
public static string StripMarkDown(string text)
Parameters
text
stringThe to remove markdown from.
Returns
- string
Gets the unformatted text.
Underline(string)
Returns a markdown-formatted string with underline formatting.
public static string Underline(string text)
Parameters
text
string
Returns
Url(string, string)
Returns a markdown-formatted URL. Only works in EmbedBuilder descriptions and fields.
public static string Url(string text, string url)
Parameters
Returns
UsernameAndDiscriminator(IUser, bool)
Formats a user's username and optional discriminator.
public static string UsernameAndDiscriminator(IUser user, bool doBidirectional)
Parameters
user
IUserThe user whose username and discriminator to format
doBidirectional
boolTo format the string in bidirectional unicode or not
Returns
- string
The username + optional discriminator.