Add banner (large) image

This commit is contained in:
spiral
2021-08-02 13:46:12 -04:00
parent 7681978435
commit e144571904
17 changed files with 231 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ namespace PluralKit.Core
public Partial<string?> DisplayName { get; set; }
public Partial<string?> Description { get; set; }
public Partial<string?> Icon { get; set; }
public Partial<string?> BannerImage { get; set; }
public Partial<string?> Color { get; set; }
public Partial<PrivacyLevel> DescriptionPrivacy { get; set; }
@@ -23,6 +24,7 @@ namespace PluralKit.Core
.With("display_name", DisplayName)
.With("description", Description)
.With("icon", Icon)
.With("banner_image", BannerImage)
.With("color", Color)
.With("description_privacy", DescriptionPrivacy)
.With("icon_privacy", IconPrivacy)
@@ -32,7 +34,9 @@ namespace PluralKit.Core
public new void CheckIsValid()
{
if (Icon.Value != null && !MiscUtils.TryMatchUri(Icon.Value, out var avatarUri))
throw new InvalidPatchException("avatar_url");
throw new InvalidPatchException("icon");
if (BannerImage.Value != null && !MiscUtils.TryMatchUri(BannerImage.Value, out var bannerImage))
throw new InvalidPatchException("banner");
if (Color.Value != null && (!Regex.IsMatch(Color.Value, "^[0-9a-fA-F]{6}$")))
throw new InvalidPatchException("color");
}