Fixed a lot of compiler warnings. Fixed 7tv connection.
This commit is contained in:
29
TTS.cs
29
TTS.cs
@@ -15,6 +15,8 @@ using TwitchChatTTS.Chat.Commands;
|
||||
using System.Text;
|
||||
using TwitchChatTTS.Chat.Speech;
|
||||
using TwitchChatTTS.Veadotube;
|
||||
using TwitchChatTTS.Bus;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
namespace TwitchChatTTS
|
||||
{
|
||||
@@ -36,6 +38,7 @@ namespace TwitchChatTTS
|
||||
private readonly IEmoteDatabase _emotes;
|
||||
private readonly TTSPlayer _player;
|
||||
private readonly AudioPlaybackEngine _playback;
|
||||
private readonly ServiceBusCentral _bus;
|
||||
private readonly Configuration _configuration;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
@@ -53,6 +56,7 @@ namespace TwitchChatTTS
|
||||
IEmoteDatabase emotes,
|
||||
TTSPlayer player,
|
||||
AudioPlaybackEngine playback,
|
||||
ServiceBusCentral bus,
|
||||
Configuration configuration,
|
||||
ILogger logger
|
||||
)
|
||||
@@ -68,9 +72,10 @@ namespace TwitchChatTTS
|
||||
_commandFactory = commandFactory;
|
||||
_commandManager = commandManager;
|
||||
_emotes = emotes;
|
||||
_configuration = configuration;
|
||||
_player = player;
|
||||
_playback = playback;
|
||||
_bus = bus;
|
||||
_configuration = configuration;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -108,6 +113,22 @@ namespace TwitchChatTTS
|
||||
_logger.Warning("Failed to check for version updates.");
|
||||
}
|
||||
|
||||
// 7tv
|
||||
var twitchTopic = _bus.GetTopic("twitch id");
|
||||
twitchTopic.FirstAsync().Subscribe(async (data) =>
|
||||
{
|
||||
var twitchId = data.Value?.ToString();
|
||||
if (twitchId == null)
|
||||
return;
|
||||
|
||||
var emoteSet = await _sevenApiClient.FetchChannelEmoteSet(_user.TwitchUserId);
|
||||
if (emoteSet != null)
|
||||
_user.SevenEmoteSetId = emoteSet.Id;
|
||||
|
||||
await InitializeEmotes(_sevenApiClient, emoteSet);
|
||||
await InitializeSevenTv();
|
||||
});
|
||||
|
||||
await InitializeHermesWebsocket();
|
||||
|
||||
_playback.AddOnMixerInputEnded((object? s, SampleProviderEventArgs e) =>
|
||||
@@ -139,14 +160,8 @@ namespace TwitchChatTTS
|
||||
return;
|
||||
}
|
||||
|
||||
var emoteSet = await _sevenApiClient.FetchChannelEmoteSet(_user.TwitchUserId.ToString());
|
||||
if (emoteSet != null)
|
||||
_user.SevenEmoteSetId = emoteSet.Id;
|
||||
|
||||
_commandManager.Update(_commandFactory);
|
||||
|
||||
await InitializeEmotes(_sevenApiClient, emoteSet);
|
||||
await InitializeSevenTv();
|
||||
await InitializeObs();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user