mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): make pk;import handle <> wrapped URLs
This commit is contained in:
parent
10287d0146
commit
683b616a1b
2 changed files with 6 additions and 3 deletions
|
|
@ -33,10 +33,10 @@ public class ImportExport
|
|||
|
||||
public async Task Import(Context ctx)
|
||||
{
|
||||
var url = ctx.RemainderOrNull() ?? ctx.Message.Attachments.FirstOrDefault()?.Url;
|
||||
if (url == null) throw Errors.NoImportFilePassed;
|
||||
var inputUrl = ctx.RemainderOrNull() ?? ctx.Message.Attachments.FirstOrDefault()?.Url;
|
||||
if (inputUrl == null) throw Errors.NoImportFilePassed;
|
||||
|
||||
if (!Core.MiscUtils.TryMatchUri(url, out var _))
|
||||
if (!Core.MiscUtils.TryMatchUri(inputUrl, out var url))
|
||||
throw Errors.InvalidUrl;
|
||||
|
||||
await ctx.BusyIndicator(async () =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue