diff --git a/src/Lavalink4NET/Players/LavalinkPlayer.cs b/src/Lavalink4NET/Players/LavalinkPlayer.cs index 217f73b8..5ba54eb3 100644 --- a/src/Lavalink4NET/Players/LavalinkPlayer.cs +++ b/src/Lavalink4NET/Players/LavalinkPlayer.cs @@ -29,7 +29,6 @@ public class LavalinkPlayer : ILavalinkPlayer, ILavalinkPlayerListener private readonly ISystemClock _systemClock; private readonly bool _disconnectOnStop; private readonly IPlayerLifecycle _playerLifecycle; - private readonly ILavalinkVoiceServerInterceptor _voiceServerInterceptor; private int _disposed; private DateTimeOffset _syncedAt; private TimeSpan _unstretchedRelativePosition; @@ -57,9 +56,7 @@ public LavalinkPlayer(IPlayerProperties p _systemClock = properties.SystemClock; _logger = properties.Logger; _syncedAt = properties.SystemClock.UtcNow; - _playerLifecycle = properties.Lifecycle; - _voiceServerInterceptor = properties.VoiceServerInterceptor; _unstretchedRelativePosition = default; _connectedOnce = false; @@ -658,10 +655,6 @@ protected virtual async ValueTask NotifyVoiceServerUpdatedAsync(VoiceServer voic return; } - voiceServer = await _voiceServerInterceptor - .InterceptAsync(GuildId, voiceServer, cancellationToken) - .ConfigureAwait(false); - VoiceServer = voiceServer; await UpdateVoiceCredentialsAsync(cancellationToken).ConfigureAwait(false); } diff --git a/src/Lavalink4NET/Players/LavalinkPlayerHandle.cs b/src/Lavalink4NET/Players/LavalinkPlayerHandle.cs index 423f00e6..40515e62 100644 --- a/src/Lavalink4NET/Players/LavalinkPlayerHandle.cs +++ b/src/Lavalink4NET/Players/LavalinkPlayerHandle.cs @@ -96,7 +96,9 @@ public async ValueTask UpdateVoiceServerAsync(VoiceServer voiceServer, Cancellat return; } - _voiceServer = voiceServer; + _voiceServer = await _playerContext.VoiceServerInterceptor + .InterceptAsync(_guildId, voiceServer, cancellationToken) + .ConfigureAwait(false); if (_voiceState is not null) {