mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 00:07:55 +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
|
|
@ -6,5 +6,6 @@ alter table members alter column hid type char(6) using rpad(hid, 6, ' ');
|
|||
alter table groups alter column hid type char(6) using rpad(hid, 6, ' ');
|
||||
|
||||
alter table system_config add column hid_display_split bool default false;
|
||||
alter table system_config add column hid_display_caps bool default false;
|
||||
|
||||
update info set schema_version = 42;
|
||||
|
|
@ -22,7 +22,7 @@ public static class HidUtils
|
|||
return hid != null;
|
||||
}
|
||||
|
||||
public static string HidTransform(string input, bool split = false)
|
||||
public static string HidTransform(string input, bool split, bool caps)
|
||||
{
|
||||
if (split && input.Length > 5)
|
||||
{
|
||||
|
|
@ -30,6 +30,9 @@ public static class HidUtils
|
|||
input = string.Concat(input.AsSpan(0, len), "-", input.AsSpan(len));
|
||||
}
|
||||
|
||||
if (caps)
|
||||
input = input.ToUpper();
|
||||
|
||||
return input;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue