#pragma warning restore 414
KMSelectable[] ProcessTwitchCommand(string command)
{
command = command.ToLowerInvariant().Trim();
if (Regex.IsMatch(command, @"^press +[0-9^, |&]+$"))
{
command = command.Substring(6).Trim();
var presses = command.Split(new[] { ',', ' ', '|', '&' }, StringSplitOptions.RemoveEmptyEntries);
var pressList = new List <KMSelectable>();
for (var i = 0; i < presses.Length; i++)
{
if (Regex.IsMatch(presses[i], @"^[0-9]{1,2}$"))
{
pressList.Add(ModuleButtons[Math.Clamp(Math.Max(1, int.Parse(presses[i].ToString())) - 1, 0, ModuleButtons.Length - 1)]);
}
}
return(pressList.ToArray());
}
if (Regex.IsMatch(command, @"^(submit|sub|s)$"))
{
return new[] { SubmitButton }
}
;
return(null);
}
}