diff --git a/src/Discord/Voice/VoiceClient.php b/src/Discord/Voice/VoiceClient.php index c68bfd57f..85a112afc 100644 --- a/src/Discord/Voice/VoiceClient.php +++ b/src/Discord/Voice/VoiceClient.php @@ -773,13 +773,13 @@ public function playRawStream($stream, int $channels = 2, int $audioRate = 48000 return $deferred->promise(); } - if ($stream === false && ! $stream instanceof Stream) { + if (! is_resource($stream) && ! $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 ($stream !== false) { + if (is_resource($stream)) { $stream = new Stream($stream, $this->loop); } @@ -832,7 +832,7 @@ public function playOggStream($stream): PromiseInterface $stream = $stream->stdout; } - if ($stream !== false) { + if (is_resource($stream)) { $stream = new ReadableResourceStream($stream, $this->loop); } @@ -948,7 +948,7 @@ public function playDCAStream($stream): PromiseInterface $stream = $stream->stdout; } - if ($stream !== false) { + if (is_resource($stream)) { $stream = new ReadableResourceStream($stream, $this->loop); }