DRY-ify checking URL length for avatars

This commit is contained in:
spiral
2020-11-22 15:43:38 -05:00
parent 7f82a3e63a
commit 05f1ee92ea
4 changed files with 4 additions and 12 deletions

View File

@@ -177,8 +177,6 @@ namespace PluralKit.Bot
{
ctx.CheckOwnGroup(target);
if (img.Url.Length > Limits.MaxUriLength)
throw Errors.InvalidUrl(img.Url);
await AvatarUtils.VerifyAvatarOrThrow(img.Url);
await _db.Execute(c => _repo.UpdateGroup(c, target.Id, new GroupPatch {Icon = img.Url}));