mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(bot): Case insensitive proxy tags matching (#490)
This commit is contained in:
parent
09ac002d26
commit
4f0236d766
14 changed files with 89 additions and 19 deletions
|
|
@ -17,6 +17,7 @@ public class SystemConfigPatch: PatchObject
|
|||
public Partial<int?> MemberLimitOverride { get; set; }
|
||||
public Partial<int?> GroupLimitOverride { get; set; }
|
||||
public Partial<string[]> DescriptionTemplates { get; set; }
|
||||
public Partial<bool> CaseSensitiveProxyTags { get; set; }
|
||||
|
||||
|
||||
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
|
||||
|
|
@ -29,6 +30,7 @@ public class SystemConfigPatch: PatchObject
|
|||
.With("member_limit_override", MemberLimitOverride)
|
||||
.With("group_limit_override", GroupLimitOverride)
|
||||
.With("description_templates", DescriptionTemplates)
|
||||
.With("case_sensitive_proxy_tags", CaseSensitiveProxyTags)
|
||||
);
|
||||
|
||||
public new void AssertIsValid()
|
||||
|
|
@ -78,6 +80,9 @@ public class SystemConfigPatch: PatchObject
|
|||
if (DescriptionTemplates.IsPresent)
|
||||
o.Add("description_templates", JArray.FromObject(DescriptionTemplates.Value));
|
||||
|
||||
if (CaseSensitiveProxyTags.IsPresent)
|
||||
o.Add("case_sensitive_proxy_tags", CaseSensitiveProxyTags.Value);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +108,9 @@ public class SystemConfigPatch: PatchObject
|
|||
if (o.ContainsKey("description_templates"))
|
||||
patch.DescriptionTemplates = o.Value<JArray>("description_templates").Select(x => x.Value<string>()).ToArray();
|
||||
|
||||
if (o.ContainsKey("case_sensitive_proxy_tags"))
|
||||
patch.CaseSensitiveProxyTags = o.Value<bool>("case_sensitive_proxy_tags");
|
||||
|
||||
return patch;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue