From f79968fdc2dcc1317be87a394a5ef5311450f82a Mon Sep 17 00:00:00 2001 From: Macintxsh <95250141+mctaylors@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:32:11 +0300 Subject: [PATCH] /about: Use Markdown.Hyperlink instead of custom extension (#229) Signed-off-by: mctaylors --- src/Commands/AboutCommandGroup.cs | 3 ++- src/Extensions/MarkdownExtensions.cs | 13 ------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Commands/AboutCommandGroup.cs b/src/Commands/AboutCommandGroup.cs index a12c070..eec1f99 100644 --- a/src/Commands/AboutCommandGroup.cs +++ b/src/Commands/AboutCommandGroup.cs @@ -15,6 +15,7 @@ using Remora.Discord.Commands.Contexts; using Remora.Discord.Commands.Feedback.Messages; using Remora.Discord.Commands.Feedback.Services; using Remora.Discord.Extensions.Embeds; +using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; @@ -90,7 +91,7 @@ public class AboutCommandGroup : CommandGroup guildId, dev.Id, ct); var tag = guildMemberResult.IsSuccess ? $"<@{dev.Id}>" - : MarkdownExtensions.Hyperlink($"@{dev.Username}", $"https://github.com/{dev.Username}"); + : Markdown.Hyperlink($"@{dev.Username}", $"https://github.com/{dev.Username}"); builder.AppendBulletPointLine($"{tag} — {$"AboutDeveloper@{dev.Username}".Localized()}"); } diff --git a/src/Extensions/MarkdownExtensions.cs b/src/Extensions/MarkdownExtensions.cs index 95cd344..7b7f780 100644 --- a/src/Extensions/MarkdownExtensions.cs +++ b/src/Extensions/MarkdownExtensions.cs @@ -13,17 +13,4 @@ public static class MarkdownExtensions { return $"- {text}"; } - - /// - /// Formats a string to use Markdown Hyperlink formatting. - /// - /// The input text to format. - /// The URL to use in formatting. - /// - /// A markdown-formatted Hyperlink string. - /// - public static string Hyperlink(string text, string url) - { - return $"[{text}]({url})"; - } }