mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 23:37:54 +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
|
|
@ -88,6 +88,13 @@ public class Config
|
|||
Limits.MaxGroupCount.ToString()
|
||||
));
|
||||
|
||||
items.Add(new(
|
||||
"Case sensitive proxy tags",
|
||||
"If proxy tags should be case sensitive",
|
||||
EnabledDisabled(ctx.Config.CaseSensitiveProxyTags),
|
||||
"enabled"
|
||||
));
|
||||
|
||||
await ctx.Paginate<PaginatedConfigItem>(
|
||||
items.ToAsyncEnumerable(),
|
||||
items.Count,
|
||||
|
|
@ -383,4 +390,27 @@ public class Config
|
|||
await ctx.Reply("Private information will now be **hidden** when looking up your own info. Use the `-private` flag to show it.");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task CaseSensitiveProxyTags(Context ctx)
|
||||
{
|
||||
if (!ctx.HasNext())
|
||||
{
|
||||
if (ctx.Config.CaseSensitiveProxyTags) { await ctx.Reply("Proxy tags are currently case sensitive"); }
|
||||
else { await ctx.Reply("Proxy tags are currently case insensitive"); }
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx.MatchToggle(true))
|
||||
{
|
||||
await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { CaseSensitiveProxyTags = true });
|
||||
|
||||
await ctx.Reply("Proxy tags are now case sensitive");
|
||||
}
|
||||
else
|
||||
{
|
||||
await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { CaseSensitiveProxyTags = false });
|
||||
|
||||
await ctx.Reply("Proxy tags are now case insensitive");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue