mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(apiv2): v2 json models
This commit is contained in:
parent
57722e035b
commit
c3e51d1a48
6 changed files with 215 additions and 69 deletions
|
|
@ -61,12 +61,16 @@ namespace PluralKit.Core
|
|||
public static string? IconFor(this PKGroup group, LookupContext ctx) =>
|
||||
group.IconPrivacy.Get(ctx, group.Icon?.TryGetCleanCdnUrl());
|
||||
|
||||
public static JObject ToJson(this PKGroup group, LookupContext ctx, bool isExport = false)
|
||||
public static JObject ToJson(this PKGroup group, LookupContext ctx, string? systemStr = null, bool isExport = false)
|
||||
{
|
||||
var o = new JObject();
|
||||
|
||||
o.Add("id", group.Hid);
|
||||
o.Add("name", group.Name);
|
||||
|
||||
if (systemStr != null)
|
||||
o.Add("system", systemStr);
|
||||
|
||||
o.Add("display_name", group.DisplayName);
|
||||
o.Add("description", group.DescriptionPrivacy.Get(ctx, group.Description));
|
||||
o.Add("icon", group.Icon);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue