Class Formatter
Inherited Members
Namespace: KSharpPlus
Assembly: KSharpPlus.dll
Syntax
public static class Formatter
Methods
| Improve this Doc View SourceBlockCode(String, String)
Creates a block of code.
Declaration
public static string BlockCode(string content, string language = "")
Parameters
Type | Name | Description |
---|---|---|
String | content | Contents of the block. |
String | language | Language to use for highlighting. |
Returns
Type | Description |
---|---|
String | Formatted block of code. |
Bold(String)
Creates bold text.
Declaration
public static string Bold(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | Text to bolden. |
Returns
Type | Description |
---|---|
String | Formatted text. |
EmbedlessUrl(Uri)
Creates a URL that won't create a link preview.
Declaration
public static string EmbedlessUrl(Uri url)
Parameters
Type | Name | Description |
---|---|---|
Uri | url | Url to prevent from being previewed. |
Returns
Type | Description |
---|---|
String | Formatted url. |
InlineCode(String)
Creates inline code snippet.
Declaration
public static string InlineCode(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | Contents of the snippet. |
Returns
Type | Description |
---|---|
String | Formatted inline code snippet. |
Italic(String)
Creates italicized text.
Declaration
public static string Italic(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | Text to italicize. |
Returns
Type | Description |
---|---|
String | Formatted text. |
Mention(KuracordChannel)
Creates a mention for specified channel.
Declaration
public static string Mention(KuracordChannel channel)
Parameters
Type | Name | Description |
---|---|---|
KuracordChannel | channel | Channel to mention. |
Returns
Type | Description |
---|---|
String | Formatted mention. |
Mention(KuracordRole)
Creates a mention for specified role.
Declaration
public static string Mention(KuracordRole role)
Parameters
Type | Name | Description |
---|---|---|
KuracordRole | role | Role to mention. |
Returns
Type | Description |
---|---|
String | Formatted mention. |
Mention(KuracordUser, Boolean)
Creates a mention for specified user or member. Can optionally specify to resolve nicknames.
Declaration
public static string Mention(KuracordUser user, bool nickname = false)
Parameters
Type | Name | Description |
---|---|---|
KuracordUser | user | User to create mention for. |
Boolean | nickname | Whether the mention should resolve nicknames or not. |
Returns
Type | Description |
---|---|
String | Formatted mention. |
Spoiler(String)
Creates spoiler from text.
Declaration
public static string Spoiler(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | Text to spoilerize. |
Returns
Type | Description |
---|---|
String | Formatted text. |
Strike(String)
Creates strikethrough text.
Declaration
public static string Strike(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | Text to strikethrough. |
Returns
Type | Description |
---|---|
String | Formatted text. |
Underline(String)
Creates underlined text.
Declaration
public static string Underline(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | Text to underline. |
Returns
Type | Description |
---|---|
String | Formatted text. |