Skip to content

Commit

Permalink
⏪ Revert changes in #1198 (Fixes #1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Mar 3, 2025
1 parent 6a1016e commit 08f83f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Discord/Voice/VoiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 08f83f5

Please sign in to comment.