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:
@@ -18,14 +18,16 @@ namespace TwitchChatTTS.Twitch.Socket.Handlers
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Task Execute(TwitchWebsocketClient sender, object? data)
|
||||
public Task Execute(TwitchWebsocketClient sender, object data)
|
||||
{
|
||||
if (data is not ChannelChatClearUserMessage message)
|
||||
return Task.CompletedTask;
|
||||
|
||||
|
||||
long broadcasterId = long.Parse(message.BroadcasterUserId);
|
||||
long chatterId = long.Parse(message.TargetUserId);
|
||||
_player.RemoveAll(chatterId);
|
||||
if (_player.Playing?.ChatterId == chatterId) {
|
||||
_player.RemoveAll(broadcasterId, chatterId);
|
||||
if (_player.Playing != null && _player.Playing.RoomId == broadcasterId && _player.Playing.ChatterId == chatterId)
|
||||
{
|
||||
_playback.RemoveMixerInput(_player.Playing.Audio!);
|
||||
_player.Playing = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user