public function setMuteDeaf($mute, $deaf)
    {
        $deferred = new Deferred();

        if (! $this->ready) {
            $deferred->reject(new \Exception('The voice client must be ready before you can set mute or deaf.'));

            return $deferred->promise();
        }

        $this->mute = $mute;
        $this->deaf = $deaf;

        $this->mainSend([
            'op' => Op::OP_VOICE_STATE_UPDATE,
            'd'  => [
                'guild_id'   => $this->channel->guild_id,
                'channel_id' => $this->channel->id,
                'self_mute'  => $mute,
                'self_deaf'  => $deaf,
            ],
        ]);

        $this->client->removeListener('message', [$this, 'handleAudioData']);

        if (! $deaf) {
            $this->client->on('message', [$this, 'handleAudioData']);
        }

        $deferred->resolve();

        return $deferred->promise();
    }
public function setMuteDeaf($mute, $deaf)
    {
        $deferred = new Deferred();

        if (! $this->ready) {
            $deferred->reject(new \Exception('The voice client must be ready before you can set mute or deaf.'));

            return $deferred->promise();
        }

        $this->mute = $mute;
        $this->deaf = $deaf;

        $this->mainSend([
            'op' => Op::OP_VOICE_STATE_UPDATE,
            'd'  => [
                'guild_id'   => $this->channel->guild_id,
                'channel_id' => $this->channel->id,
                'self_mute'  => $mute,
                'self_deaf'  => $deaf,
            ],
        ]);

        $this->client->removeListener('message', [$this, 'handleAudioData']);

        if (! $deaf) {
            $this->client->on('message', [$this, 'handleAudioData']);
        }

        $deferred->resolve();

        return $deferred->promise();
    }
public function setMuteDeaf ( $ mute , $ deaf ) { $ deferred = new Deferred ( ) ; if ( ! $ this -> ready ) { $ deferred -> reject ( new \ Exception ( 'The voice client must be ready before you can set mute or deaf.' ) ) ; return $ deferred -> promise ( ) ; } $ this -> mute = $ mute ; $ this -> deaf = $ deaf ; $ this -> mainSend ( [ 'op' => Op :: OP_VOICE_STATE_UPDATE , 'd' => [ 'guild_id' => $ this -> channel -> guild_id , 'channel_id' => $ this -> channel -> id , 'self_mute' => $ mute , 'self_deaf' => $ deaf , ] , ] ) ; $ this -> client -> removeListener ( 'message' , [ $ this , 'handleAudioData' ] ) ; if ( ! $ deaf ) { $ this -> client -> on ( 'message' , [ $ this , 'handleAudioData' ] ) ; } $ deferred -> resolve ( ) ; return $ deferred -> promise ( ) ; }
Changes your mute and deaf value.

@param bool $mute Whether you should be muted.
@param bool $deaf Whether you should be deaf.

@return void
Changes your mute and deaf value .