From 17fbdf553ca86d8382c47415c490a37d91dc326e Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 7 Jul 2020 23:52:54 +0200 Subject: [PATCH] Allow de-embedding image links with <> --- PluralKit.Bot/Commands/Avatars/ContextAvatarExt.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PluralKit.Bot/Commands/Avatars/ContextAvatarExt.cs b/PluralKit.Bot/Commands/Avatars/ContextAvatarExt.cs index 612db325..382d064d 100644 --- a/PluralKit.Bot/Commands/Avatars/ContextAvatarExt.cs +++ b/PluralKit.Bot/Commands/Avatars/ContextAvatarExt.cs @@ -30,6 +30,10 @@ namespace PluralKit.Bot var arg = ctx.RemainderOrNull(); if (arg != null) { + // Allow surrounding the URL with to "de-embed" + if (arg.StartsWith("<") && arg.EndsWith(">")) + arg = arg.Substring(1, arg.Length - 2); + if (!Uri.TryCreate(arg, UriKind.Absolute, out var uri)) throw Errors.InvalidUrl(arg);