Fixed 7tv & Twitch reconnection. Added adbreak, follow, subscription handlers for Twitch. Added multi-chat support. Added support to unsubscribe from Twitch event subs.

This commit is contained in:
Tom
2024-08-06 19:29:29 +00:00
parent 75fcb8e0f8
commit 8014c12bc5
60 changed files with 1064 additions and 672 deletions

View File

@@ -0,0 +1,41 @@
using Serilog;
using static TwitchChatTTS.Chat.Commands.TTSCommands;
namespace TwitchChatTTS.Chat.Commands
{
public class CommandFactory : ICommandFactory
{
private readonly IEnumerable<IChatCommand> _commands;
private readonly ICommandBuilder _builder;
private readonly ILogger _logger;
public CommandFactory(
IEnumerable<IChatCommand> commands,
ICommandBuilder builder,
ILogger logger
)
{
_commands = commands;
_builder = builder;
_logger = logger;
}
public ICommandSelector Build()
{
foreach (var command in _commands)
{
try
{
_logger.Debug($"Creating command tree for '{command.Name}'.");
command.Build(_builder);
}
catch (Exception e)
{
_logger.Error(e, $"Failed to properly load a chat command [command name: {command.Name}]");
}
}
return _builder.Build();
}
}
}