mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(bot): add proxy error config (#544)
This commit is contained in:
parent
020a6f99fe
commit
8187aa05b7
10 changed files with 93 additions and 7 deletions
|
|
@ -18,6 +18,7 @@ public class SystemConfigPatch: PatchObject
|
|||
public Partial<int?> GroupLimitOverride { get; set; }
|
||||
public Partial<string[]> DescriptionTemplates { get; set; }
|
||||
public Partial<bool> CaseSensitiveProxyTags { get; set; }
|
||||
public Partial<bool> ProxyErrorMessageEnabled { get; set; }
|
||||
|
||||
|
||||
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
|
||||
|
|
@ -31,6 +32,7 @@ public class SystemConfigPatch: PatchObject
|
|||
.With("group_limit_override", GroupLimitOverride)
|
||||
.With("description_templates", DescriptionTemplates)
|
||||
.With("case_sensitive_proxy_tags", CaseSensitiveProxyTags)
|
||||
.With("proxy_error_message_enabled", ProxyErrorMessageEnabled)
|
||||
);
|
||||
|
||||
public new void AssertIsValid()
|
||||
|
|
@ -83,6 +85,9 @@ public class SystemConfigPatch: PatchObject
|
|||
if (CaseSensitiveProxyTags.IsPresent)
|
||||
o.Add("case_sensitive_proxy_tags", CaseSensitiveProxyTags.Value);
|
||||
|
||||
if (ProxyErrorMessageEnabled.IsPresent)
|
||||
o.Add("proxy_error_message_enabled", ProxyErrorMessageEnabled.Value);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
|
@ -111,6 +116,9 @@ public class SystemConfigPatch: PatchObject
|
|||
if (o.ContainsKey("case_sensitive_proxy_tags"))
|
||||
patch.CaseSensitiveProxyTags = o.Value<bool>("case_sensitive_proxy_tags");
|
||||
|
||||
if (o.ContainsKey("proxy_error_message_enabled"))
|
||||
patch.ProxyErrorMessageEnabled = o.Value<bool>("proxy_error_message_enabled");
|
||||
|
||||
return patch;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue