Add color to system JSON representation
This commit is contained in:
parent
d49b9f9bb7
commit
65b4f0e370
@ -72,6 +72,7 @@ namespace PluralKit.Core
|
||||
o.Add("tag", system.Tag);
|
||||
o.Add("avatar_url", system.AvatarUrl.TryGetCleanCdnUrl());
|
||||
o.Add("banner", system.DescriptionPrivacy.Get(ctx, system.BannerImage).TryGetCleanCdnUrl());
|
||||
o.Add("color", system.Color);
|
||||
o.Add("created", system.Created.FormatExport());
|
||||
// todo: change this to "timezone"
|
||||
o.Add("tz", system.UiTz);
|
||||
|
@ -77,6 +77,7 @@ namespace PluralKit.Core
|
||||
if (o.ContainsKey("tag")) patch.Tag = o.Value<string>("tag").NullIfEmpty();
|
||||
if (o.ContainsKey("avatar_url")) patch.AvatarUrl = o.Value<string>("avatar_url").NullIfEmpty();
|
||||
if (o.ContainsKey("banner")) patch.BannerImage = o.Value<string>("banner").NullIfEmpty();
|
||||
if (o.ContainsKey("color")) patch.Color = o.Value<string>("color").NullIfEmpty();
|
||||
if (o.ContainsKey("timezone")) patch.UiTz = o.Value<string>("tz") ?? "UTC";
|
||||
|
||||
// legacy: APIv1 uses "tz" instead of "timezone"
|
||||
|
@ -55,6 +55,7 @@ A `?` after the column type indicates a nullable parameter (value can be cleared
|
||||
| name | string | Yes | 100-character limit. |
|
||||
| description | string? | Yes | 1000-character limit. |
|
||||
| tag | string? | Yes | |
|
||||
| color | string? | Yes | 6-char hex (eg. `ff7000`), sans `#`. |
|
||||
| avatar_url | url? | Yes | Not validated server-side. |
|
||||
| banner | url? | Yes | Not validated server-side. |
|
||||
| tz | string? | Yes | Tzdb identifier. Patching with `null` will store `"UTC"`. |
|
||||
|
Loading…
Reference in New Issue
Block a user