diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index 9a13ec47..373e867f 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -161,7 +161,7 @@ namespace PluralKit.Bot { var eb = new EmbedBuilder() // TODO: add URL of website when that's up - .Author(new(name, IconUrl: DiscordUtils.WorkaroundForUrlBug(avatar.TryGetCleanCdnUrl()))) + .Author(new(name, IconUrl: avatar.TryGetCleanCdnUrl())) // .WithColor(member.ColorPrivacy.CanAccess(ctx) ? color : DiscordUtils.Gray) .Color(color) .Footer(new( @@ -231,7 +231,7 @@ namespace PluralKit.Bot { } var eb = new EmbedBuilder() - .Author(new(nameField, IconUrl: DiscordUtils.WorkaroundForUrlBug(target.IconFor(pctx)))) + .Author(new(nameField, IconUrl: target.IconFor(pctx))) .Color(color) .Footer(new($"System ID: {system.Hid} | Group ID: {target.Hid} | Created on {target.Created.FormatZoned(system)}")); @@ -324,7 +324,7 @@ namespace PluralKit.Bot { // Put it all together var eb = new EmbedBuilder() - .Author(new(msg.Member.NameFor(ctx), IconUrl: DiscordUtils.WorkaroundForUrlBug(msg.Member.AvatarFor(ctx).TryGetCleanCdnUrl()))) + .Author(new(msg.Member.NameFor(ctx), IconUrl: msg.Member.AvatarFor(ctx).TryGetCleanCdnUrl())) .Description(serverMsg?.Content?.NormalizeLineEndSpacing() ?? "*(message contents deleted or inaccessible)*") .Image(new(serverMsg?.Attachments?.FirstOrDefault()?.Url)) .Field(new("System", diff --git a/PluralKit.Bot/Utils/DiscordUtils.cs b/PluralKit.Bot/Utils/DiscordUtils.cs index 62ce0169..80686ea1 100644 --- a/PluralKit.Bot/Utils/DiscordUtils.cs +++ b/PluralKit.Bot/Utils/DiscordUtils.cs @@ -56,12 +56,6 @@ namespace PluralKit.Bot } } - public static string WorkaroundForUrlBug(string input) - { - // Workaround for https://github.com/DSharpPlus/DSharpPlus/issues/565 - return input?.Replace("%20", "+"); - } - public static uint? ToDiscordColor(this string color) { if (uint.TryParse(color, NumberStyles.HexNumber, null, out var colorInt)) diff --git a/PluralKit.Bot/Utils/MiscUtils.cs b/PluralKit.Bot/Utils/MiscUtils.cs index abd373c0..0a5929f1 100644 --- a/PluralKit.Bot/Utils/MiscUtils.cs +++ b/PluralKit.Bot/Utils/MiscUtils.cs @@ -55,11 +55,6 @@ namespace PluralKit.Bot { // This function filters out sporadic errors out of our control from being reported to Sentry // otherwise we'd blow out our error reporting budget as soon as Discord takes a dump, or something. - - // Discord server errors are *not our problem* - // TODO: DSharpPlus doesn't have a generic "HttpException" type and only special cases a couple response codes (that we don't need here) - // Doesn't seem to handle 500s in the library at all, I'm not sure what it does in case it receives one... - // if (e is DSharpPlus.Exceptions he && ((int) he.HttpCode) >= 500) return false; // Occasionally Discord's API will Have A Bad Time and return a bunch of CloudFlare errors (in HTML format). // The library tries to parse these HTML responses as JSON and crashes with a consistent exception message.