Added a simple method for subscribing to events.

This commit is contained in:
Tom
2025-01-07 15:42:10 +00:00
parent 64cb0c1f6d
commit b724cd00eb
4 changed files with 15 additions and 8 deletions

View File

@ -66,18 +66,18 @@ namespace TwitchChatTTS.Hermes.Socket
_lock = new object();
var ttsCreateUserVoice = _bus.GetTopic("tts.user.voice.create");
ttsCreateUserVoice.Subscribe(new ServiceBusObserver(async data => await Send(3, new RequestMessage()
ttsCreateUserVoice.Subscribe(async data => await Send(3, new RequestMessage()
{
Type = "create_tts_user",
Data = (IDictionary<string, object>) data.Value!
}), logger));
}));
var ttsUpdateUserVoice = _bus.GetTopic("tts.user.voice.update");
ttsUpdateUserVoice.Subscribe(new ServiceBusObserver(async data => await Send(3, new RequestMessage()
ttsUpdateUserVoice.Subscribe(async data => await Send(3, new RequestMessage()
{
Type = "update_tts_user",
Data = (IDictionary<string, object>) data.Value!
}), logger));
}));
}