From af801e2b01ca3a4354514ed1fc8f4b3e05467a8f Mon Sep 17 00:00:00 2001 From: spiral Date: Thu, 1 Jul 2021 01:59:04 -0400 Subject: [PATCH] properly encode custom emojis in emoji API routes --- Myriad/Rest/DiscordApiClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myriad/Rest/DiscordApiClient.cs b/Myriad/Rest/DiscordApiClient.cs index 1b4299ea..0e68e931 100644 --- a/Myriad/Rest/DiscordApiClient.cs +++ b/Myriad/Rest/DiscordApiClient.cs @@ -129,7 +129,7 @@ namespace Myriad.Rest _client.Post($"/users/@me/channels", ("CreateDM", default), new CreateDmRequest(recipientId))!; private static string EncodeEmoji(Emoji emoji) => - WebUtility.UrlEncode(emoji.Name) ?? emoji.Id?.ToString() ?? + WebUtility.UrlEncode(emoji.Id != null ? $"{emoji.Name}:{emoji.Id}" : emoji.Name) ?? throw new ArgumentException("Could not encode emoji"); } } \ No newline at end of file