feat(bot): add option for hid capitalization

This commit is contained in:
Iris System 2024-04-28 21:05:46 +12:00
parent a3f1601938
commit 1ce9227b7d
7 changed files with 44 additions and 2 deletions

View file

@ -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;

View file

@ -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;
}
}