Added Veadotube integration

This commit is contained in:
Tom
2024-12-02 20:51:04 +00:00
parent 48dd6858a1
commit b35183249b
8 changed files with 323 additions and 0 deletions

View File

@ -10,6 +10,7 @@ using TwitchChatTTS.Bus.Data;
using TwitchChatTTS.Hermes.Socket;
using TwitchChatTTS.OBS.Socket;
using TwitchChatTTS.OBS.Socket.Data;
using TwitchChatTTS.Veadotube;
namespace TwitchChatTTS.Twitch.Redemptions
{
@ -20,6 +21,7 @@ namespace TwitchChatTTS.Twitch.Redemptions
private readonly User _user;
private readonly OBSSocketClient _obs;
private readonly HermesSocketClient _hermes;
private readonly VeadoSocketClient _veado;
private readonly NightbotApiClient _nightbot;
private readonly AudioPlaybackEngine _playback;
private readonly ILogger _logger;
@ -32,6 +34,7 @@ namespace TwitchChatTTS.Twitch.Redemptions
User user,
[FromKeyedServices("obs")] SocketClient<WebSocketMessage> obs,
[FromKeyedServices("hermes")] SocketClient<WebSocketMessage> hermes,
[FromKeyedServices("veadotube")] SocketClient<object> veado,
NightbotApiClient nightbot,
AudioPlaybackEngine playback,
ILogger logger)
@ -41,6 +44,7 @@ namespace TwitchChatTTS.Twitch.Redemptions
_user = user;
_obs = (obs as OBSSocketClient)!;
_hermes = (hermes as HermesSocketClient)!;
_veado = (veado as VeadoSocketClient)!;
_nightbot = nightbot;
_playback = playback;
_logger = logger;
@ -220,6 +224,15 @@ namespace TwitchChatTTS.Twitch.Redemptions
case "NIGHTBOT_CLEAR_QUEUE":
await _nightbot.ClearQueue();
break;
case "VEADOTUBE_SET_STATE":
await _veado.SetCurrentState(action.Data["state"]);
break;
case "VEADOTUBE_PUSH_STATE":
await _veado.PushState(action.Data["state"]);
break;
case "VEADOTUBE_POP_STATE":
await _veado.PopState(action.Data["state"]);
break;
default:
_logger.Warning($"Unknown redeemable action has occured. Update needed? [type: {action.Type}][chatter: {senderDisplayName}][chatter id: {senderId}]");
break;