/about: Use Markdown.Hyperlink instead of custom extension (#229)

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2023-12-19 13:32:11 +03:00 committed by GitHub
parent c0b43c6a18
commit f79968fdc2
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 14 deletions

View file

@ -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()}");
}

View file

@ -13,17 +13,4 @@ public static class MarkdownExtensions
{
return $"- {text}";
}
/// <summary>
/// Formats a string to use Markdown Hyperlink formatting.
/// </summary>
/// <param name="text">The input text to format.</param>
/// <param name="url">The URL to use in formatting.</param>
/// <returns>
/// A markdown-formatted Hyperlink string.
/// </returns>
public static string Hyperlink(string text, string url)
{
return $"[{text}]({url})";
}
}