Table of Contents

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 string

The 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

string

Code(string, string)

Returns a markdown-formatted string with codeblock formatting.

public static string Code(string text, string language = null)

Parameters

text string
language string

Returns

string

EscapeUrl(string)

Escapes a URL so that a preview is not generated.

public static string EscapeUrl(string url)

Parameters

url string

Returns

string

Italics(string)

Returns a markdown-formatted string with italics formatting.

public static string Italics(string text)

Parameters

text string

Returns

string

Quote(string)

Formats a string as a quote.

public static string Quote(string text)

Parameters

text string

The 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

string

Spoiler(string)

Returns a string with spoiler formatting.

public static string Spoiler(string text)

Parameters

text string

Returns

string

Strikethrough(string)

Returns a markdown-formatted string with strike-through formatting.

public static string Strikethrough(string text)

Parameters

text string

Returns

string

StripMarkDown(string)

Remove discord supported markdown from text.

public static string StripMarkDown(string text)

Parameters

text string

The 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

string

Url(string, string)

Returns a markdown-formatted URL. Only works in EmbedBuilder descriptions and fields.

public static string Url(string text, string url)

Parameters

text string
url string

Returns

string

UsernameAndDiscriminator(IUser, bool)

Formats a user's username and optional discriminator.

public static string UsernameAndDiscriminator(IUser user, bool doBidirectional)

Parameters

user IUser

The user whose username and discriminator to format

doBidirectional bool

To format the string in bidirectional unicode or not

Returns

string

The username + optional discriminator.