Added several redemption actions. Added certain login features. Fixed OBS command. Added more logging.

This commit is contained in:
Tom
2024-07-07 03:42:33 +00:00
parent 706eecf2d2
commit af3763a837
20 changed files with 490 additions and 234 deletions

View File

@ -35,19 +35,23 @@ namespace TwitchChatTTS.Chat.Commands
public override async Task Execute(IList<string> args, ChatMessage message, long broadcasterId)
{
if (_user == null || _user.VoicesSelected == null || _user.VoicesAvailable == null)
if (_user == null || _user.VoicesSelected == null || _user.VoicesEnabled == null)
return;
long chatterId = long.Parse(message.UserId);
var voiceName = args.First().ToLower();
var voice = _user.VoicesAvailable.First(v => v.Value.ToLower() == voiceName);
var enabled = _user.VoicesEnabled.Contains(voice.Value);
await _hermesClient.Send(3, new RequestMessage()
if (enabled)
{
Type = _user.VoicesSelected.ContainsKey(chatterId) ? "update_tts_user" : "create_tts_user",
Data = new Dictionary<string, object>() { { "chatter", chatterId }, { "voice", voice.Key } }
});
_logger.Information($"Updated chat TTS voice [voice: {voice.Value}][username: {message.Username}].");
await _hermesClient.Send(3, new RequestMessage()
{
Type = _user.VoicesSelected.ContainsKey(chatterId) ? "update_tts_user" : "create_tts_user",
Data = new Dictionary<string, object>() { { "chatter", chatterId }, { "voice", voice.Key } }
});
_logger.Debug($"Sent request to update chat TTS voice [voice: {voice.Value}][username: {message.Username}].");
}
}
}
}