public function setSpeaking($speaking = true)
    {
        $deferred = new Deferred();

        if ($this->speaking == $speaking) {
            $deferred->resolve();

            return $deferred->promise();
        }

        if (! $this->ready) {
            $deferred->reject(new \Exception('Voice Client is not ready.'));

            return $deferred->promise();
        }

        $this->send([
            'op' => Op::VOICE_SPEAKING,
            'd'  => [
                'speaking' => $speaking,
                'delay'    => 0,
            ],
        ]);

        $this->speaking = $speaking;

        $deferred->resolve();

        return $deferred->promise();
    }
public function setSpeaking($speaking = true)
    {
        $deferred = new Deferred();

        if ($this->speaking == $speaking) {
            $deferred->resolve();

            return $deferred->promise();
        }

        if (! $this->ready) {
            $deferred->reject(new \Exception('Voice Client is not ready.'));

            return $deferred->promise();
        }

        $this->send([
            'op' => Op::VOICE_SPEAKING,
            'd'  => [
                'speaking' => $speaking,
                'delay'    => 0,
            ],
        ]);

        $this->speaking = $speaking;

        $deferred->resolve();

        return $deferred->promise();
    }
public function setSpeaking ( $ speaking = true ) { $ deferred = new Deferred ( ) ; if ( $ this -> speaking == $ speaking ) { $ deferred -> resolve ( ) ; return $ deferred -> promise ( ) ; } if ( ! $ this -> ready ) { $ deferred -> reject ( new \ Exception ( 'Voice Client is not ready.' ) ) ; return $ deferred -> promise ( ) ; } $ this -> send ( [ 'op' => Op :: VOICE_SPEAKING , 'd' => [ 'speaking' => $ speaking , 'delay' => 0 , ] , ] ) ; $ this -> speaking = $ speaking ; $ deferred -> resolve ( ) ; return $ deferred -> promise ( ) ; }
Sets the speaking value of the client.

@param bool $speaking Whether the client is speaking or not.

@return bool Whether the client is speaking or not.
Sets the speaking value of the client .