mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 01:00:12 +00:00
Allow de-embedding image links with <>
This commit is contained in:
parent
8d01b580e2
commit
17fbdf553c
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue