Skip to content

Commit

Permalink
feature: add Format.Url, Format.EscapeUrl
Browse files Browse the repository at this point in the history
Format.Url formats a URL into a markdown `[]()` masked URL.

Format.EscapeUrl formats a URL into a Discord `<>` escaped URL.
  • Loading branch information
foxbot committed Nov 27, 2018
1 parent a64ab60 commit f005af3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Discord.Net.Core/Format.cs
Expand Up @@ -14,6 +14,10 @@ public static class Format
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 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>
public static string EscapeUrl(string url) => $"<{url}>";

/// <summary> Returns a markdown-formatted string with codeblock formatting. </summary>
public static string Code(string text, string language = null)
Expand Down

0 comments on commit f005af3

Please sign in to comment.