Allow de-embedding image links with <>
This commit is contained in:
parent
8d01b580e2
commit
17fbdf553c
@ -30,6 +30,10 @@ namespace PluralKit.Bot
|
|||||||
var arg = ctx.RemainderOrNull();
|
var arg = ctx.RemainderOrNull();
|
||||||
if (arg != null)
|
if (arg != null)
|
||||||
{
|
{
|
||||||
|
// Allow surrounding the URL with <angle brackets> to "de-embed"
|
||||||
|
if (arg.StartsWith("<") && arg.EndsWith(">"))
|
||||||
|
arg = arg.Substring(1, arg.Length - 2);
|
||||||
|
|
||||||
if (!Uri.TryCreate(arg, UriKind.Absolute, out var uri))
|
if (!Uri.TryCreate(arg, UriKind.Absolute, out var uri))
|
||||||
throw Errors.InvalidUrl(arg);
|
throw Errors.InvalidUrl(arg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user