Task CreateVoiceUdpSocket() { if (udpSocket != null && udpSocket.IsConnected) { throw new InvalidOperationException("[CreateVoiceUdpSocket] udpSocket must be null or disconnected!"); } if (!ssrc.HasValue) { throw new InvalidOperationException("[CreateVoiceUdpSocket] ssrc must not be null!"); } udpSocket = new VoiceUdpSocket($"VoiceUDPSocket:{guildId}", ssrc.Value); udpSocket.OnClosedPrematurely += UdpSocket_OnClosedPrematurely; log.LogVerbose("[CreateVoiceUdpSocket] Created VoiceUdpSocket."); return(Task.CompletedTask); }