Changed command dictionary to a command tree. Fixed various requests. OBS reconnection added if identified previously.

This commit is contained in:
Tom
2024-07-19 16:56:41 +00:00
parent e6b3819356
commit 472bfcee5d
56 changed files with 1943 additions and 1553 deletions

View File

@ -1,11 +1,13 @@
namespace TwitchChatTTS.Chat.Commands.Parameters
{
public class TTSVoiceNameParameter : ChatCommandParameter
public class TTSVoiceNameParameter : CommandParameter
{
private bool _enabled;
private readonly User _user;
public TTSVoiceNameParameter(User user, bool optional = false) : base("TTS Voice Name", "Name of a TTS voice", optional)
public TTSVoiceNameParameter(string name, bool enabled, User user, bool optional = false) : base(name, optional)
{
_enabled = enabled;
_user = user;
}
@ -13,8 +15,11 @@ namespace TwitchChatTTS.Chat.Commands.Parameters
{
if (_user.VoicesAvailable == null)
return false;
value = value.ToLower();
if (_enabled)
return _user.VoicesEnabled.Any(v => v.ToLower() == value);
return _user.VoicesAvailable.Any(e => e.Value.ToLower() == value);
}
}