feat(webhooks): init, add service/models, add JSON to patch objects

This commit is contained in:
spiral
2021-11-02 06:08:17 -04:00
parent 08c5b78cc2
commit 71aec0d419
14 changed files with 551 additions and 2 deletions

View File

@@ -46,6 +46,8 @@ namespace PluralKit.Core
public string BannerImage { get; }
public string Color { get; }
public string Token { get; }
public string WebhookUrl { get; }
public string WebhookToken { get; }
public Instant Created { get; }
public string UiTz { get; set; }
public bool PingsEnabled { get; }
@@ -100,6 +102,10 @@ namespace PluralKit.Core
if (ctx == LookupContext.ByOwner)
{
// todo: should this be moved to a different JSON model?
o.Add("webhook_url", system.WebhookUrl);
o.Add("webhook_token", system.WebhookToken);
var p = new JObject();
p.Add("description_privacy", system.DescriptionPrivacy.ToJsonString());