diff --git a/src/Discord/Voice/VoiceClient.php b/src/Discord/Voice/VoiceClient.php index adcc51535..3fb5f3fc3 100644 --- a/src/Discord/Voice/VoiceClient.php +++ b/src/Discord/Voice/VoiceClient.php @@ -743,13 +743,13 @@ public function playRawStream($stream, int $channels = 2, int $audioRate = 48000 return $deferred->promise(); } - if (! is_resource($stream) && ! $stream instanceof Stream) { + if ($stream === false && ! $stream instanceof Stream) { $deferred->reject(new \InvalidArgumentException('The stream passed to playRawStream was not an instance of resource or ReactPHP Stream.')); return $deferred->promise(); } - if (is_resource($stream)) { + if ($stream !== false) { $stream = new Stream($stream, $this->loop); } @@ -802,7 +802,7 @@ public function playOggStream($stream): ExtendedPromiseInterface $stream = $stream->stdout; } - if (is_resource($stream)) { + if ($stream !== false) { $stream = new ReadableResourceStream($stream, $this->loop); } @@ -918,7 +918,7 @@ public function playDCAStream($stream): ExtendedPromiseInterface $stream = $stream->stdout; } - if (is_resource($stream)) { + if ($stream !== false) { $stream = new ReadableResourceStream($stream, $this->loop); }