mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
feat(bot): add option for hid capitalization
This commit is contained in:
parent
a3f1601938
commit
1ce9227b7d
7 changed files with 44 additions and 2 deletions
|
|
@ -109,6 +109,13 @@ public class Config
|
|||
"disabled"
|
||||
));
|
||||
|
||||
items.Add(new(
|
||||
"Capitalize IDs",
|
||||
"Whether to display IDs as capital letters, to ease readability",
|
||||
EnabledDisabled(ctx.Config.HidDisplayCaps),
|
||||
"disabled"
|
||||
));
|
||||
|
||||
await ctx.Paginate<PaginatedConfigItem>(
|
||||
items.ToAsyncEnumerable(),
|
||||
items.Count,
|
||||
|
|
@ -464,4 +471,18 @@ public class Config
|
|||
await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { HidDisplaySplit = newVal });
|
||||
await ctx.Reply($"Splitting of 6-character IDs with a hyphen is now {EnabledDisabled(newVal)}.");
|
||||
}
|
||||
|
||||
public async Task HidDisplayCaps(Context ctx)
|
||||
{
|
||||
if (!ctx.HasNext())
|
||||
{
|
||||
var msg = $"Displaying IDs as capital letters is currently **{EnabledDisabled(ctx.Config.HidDisplayCaps)}**.";
|
||||
await ctx.Reply(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
var newVal = ctx.MatchToggle(true);
|
||||
await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { HidDisplayCaps = newVal });
|
||||
await ctx.Reply($"Displaying IDs as capital letters is now {EnabledDisabled(newVal)}.");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue