remove some unused/legacy code
This commit is contained in:
parent
9fd4f327e0
commit
c27cbeed01
@ -161,7 +161,7 @@ namespace PluralKit.Bot {
|
|||||||
|
|
||||||
var eb = new EmbedBuilder()
|
var eb = new EmbedBuilder()
|
||||||
// TODO: add URL of website when that's up
|
// 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)
|
// .WithColor(member.ColorPrivacy.CanAccess(ctx) ? color : DiscordUtils.Gray)
|
||||||
.Color(color)
|
.Color(color)
|
||||||
.Footer(new(
|
.Footer(new(
|
||||||
@ -231,7 +231,7 @@ namespace PluralKit.Bot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var eb = new EmbedBuilder()
|
var eb = new EmbedBuilder()
|
||||||
.Author(new(nameField, IconUrl: DiscordUtils.WorkaroundForUrlBug(target.IconFor(pctx))))
|
.Author(new(nameField, IconUrl: target.IconFor(pctx)))
|
||||||
.Color(color)
|
.Color(color)
|
||||||
.Footer(new($"System ID: {system.Hid} | Group ID: {target.Hid} | Created on {target.Created.FormatZoned(system)}"));
|
.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
|
// Put it all together
|
||||||
var eb = new EmbedBuilder()
|
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)*")
|
.Description(serverMsg?.Content?.NormalizeLineEndSpacing() ?? "*(message contents deleted or inaccessible)*")
|
||||||
.Image(new(serverMsg?.Attachments?.FirstOrDefault()?.Url))
|
.Image(new(serverMsg?.Attachments?.FirstOrDefault()?.Url))
|
||||||
.Field(new("System",
|
.Field(new("System",
|
||||||
|
@ -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)
|
public static uint? ToDiscordColor(this string color)
|
||||||
{
|
{
|
||||||
if (uint.TryParse(color, NumberStyles.HexNumber, null, out var colorInt))
|
if (uint.TryParse(color, NumberStyles.HexNumber, null, out var colorInt))
|
||||||
|
@ -55,11 +55,6 @@ namespace PluralKit.Bot
|
|||||||
{
|
{
|
||||||
// This function filters out sporadic errors out of our control from being reported to Sentry
|
// 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.
|
// 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).
|
// 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.
|
// The library tries to parse these HTML responses as JSON and crashes with a consistent exception message.
|
||||||
|
Loading…
Reference in New Issue
Block a user