Ensure the required gateway intent is available when connected to audio (#3108)

This commit is contained in:
Suiram1701
2025-05-09 19:54:28 +02:00
committed by GitHub
parent be8e6e0394
commit f1ff1913cf

View File

@@ -1748,6 +1748,8 @@ namespace Discord.WebSocket
} }
internal async Task<IAudioClient> ConnectAudioAsync(ulong channelId, bool selfDeaf, bool selfMute, bool external, bool disconnect = true) internal async Task<IAudioClient> ConnectAudioAsync(ulong channelId, bool selfDeaf, bool selfMute, bool external, bool disconnect = true)
{ {
Discord.EnsureGatewayIntent(GatewayIntents.GuildVoiceStates);
TaskCompletionSource<AudioClient> promise; TaskCompletionSource<AudioClient> promise;
await _audioLock.WaitAsync().ConfigureAwait(false); await _audioLock.WaitAsync().ConfigureAwait(false);