Skip to content

Commit 2fd81ae

Browse files
committed
handleAny, handleFlags
1 parent 0e308d4 commit 2fd81ae

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

  • src/Discord/Voice/Client

src/Discord/Voice/Client/WS.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
use Discord\Discord;
1717
use Discord\Factory\SocketFactory;
1818
use Discord\Parts\Voice\UserConnected;
19+
use Discord\Voice\Any;
1920
use Discord\Voice\Client;
21+
use Discord\Voice\Flags;
2022
use Discord\Voice\Resumed;
2123
use Discord\Voice\SessionDescription;
2224
use Discord\Voice\Speaking;
@@ -207,10 +209,6 @@ public function handleConnection(WebSocket $ws): void
207209
//$this->handleUndocumented($data);
208210

209211
switch ($data->op) {
210-
case Op::VOICE_CLIENT_UNKNOWN_15:
211-
case Op::VOICE_CLIENT_UNKNOWN_18:
212-
$this->discord->logger->debug('received unknown opcode', ['data' => json_decode(json_encode($data), true)]);
213-
break;
214212
case Op::VOICE_CLIENT_PLATFORM:
215213
$this->discord->logger->debug('received platform packet', ['data' => json_decode(json_encode($data->d), true)]);
216214
# handlePlatformPerUser
@@ -412,6 +410,30 @@ protected function handleClientDisconnect(object $data): void
412410
unset($this->vc->clientsConnected[$data->d->user_id]);
413411
}
414412

413+
/**
414+
* Handles the any event from the voice server.
415+
*
416+
* @param Payload $data
417+
*/
418+
public function handleAny(object $data): void
419+
{
420+
$any = $this->discord->factory(Any::class, (array) $data->d, true);
421+
422+
$this->discord->logger->debug('received any packet', ['data' => $any->__debugInfo()]);
423+
}
424+
425+
/**
426+
* Handles the flags event from the voice server.
427+
*
428+
* @param Payload $data
429+
*/
430+
protected function handleFlags(object $data): void
431+
{
432+
$flags = $this->discord->factory(Flags::class, (array) $data->d, true);
433+
434+
$this->discord->logger->debug('received flags packet', ['data' => $flags->__debugInfo()]);
435+
}
436+
415437
protected function handleDavePrepareTransition($data): void
416438
{
417439
$this->discord->logger->debug('DAVE Prepare Transition', ['data' => $data]);

0 commit comments

Comments
 (0)