Browse Source

Add support for spoiler formatting

pull/1255/head
Chris Johnston 6 years ago
parent
commit
e923f180b3
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net.Core/Format.cs

+ 3
- 1
src/Discord.Net.Core/Format.cs View File

@@ -4,7 +4,7 @@ namespace Discord
public static class Format
{
// Characters which need escaping
private static readonly string[] SensitiveCharacters = { "\\", "*", "_", "~", "`" };
private static readonly string[] SensitiveCharacters = { "\\", "*", "_", "~", "`", "|" };

/// <summary> Returns a markdown-formatted string with bold formatting. </summary>
public static string Bold(string text) => $"**{text}**";
@@ -14,6 +14,8 @@ namespace Discord
public static string Underline(string text) => $"__{text}__";
/// <summary> Returns a markdown-formatted string with strikethrough formatting. </summary>
public static string Strikethrough(string text) => $"~~{text}~~";
/// <summary> Returns a string with spoiler formatting. </summary>
public static string Spoiler(string text) => $"||{text}||";
/// <summary> Returns a markdown-formatted URL. Only works in <see cref="EmbedBuilder"/> descriptions and fields. </summary>
public static string Url(string text, string url) => $"[{text}]({url})";
/// <summary> Escapes a URL so that a preview is not generated. </summary>


Loading…
Cancel
Save