function delete(string $reason = '') {
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($reason) {
            $method = 'deleteWebhook';
            $args = array($this->id, $reason);
            
            if(!empty($this->token)) {
                $method = 'deleteWebhookToken';
                $args = array($this->id, $this->token, $reason);
            }
            
            $this->client->apimanager()->endpoints->webhook->$method(...$args)->done(function () use ($resolve) {
                $resolve();
            }, $reject);
        }));
    }
function delete(string $reason = '') {
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($reason) {
            $method = 'deleteWebhook';
            $args = array($this->id, $reason);
            
            if(!empty($this->token)) {
                $method = 'deleteWebhookToken';
                $args = array($this->id, $this->token, $reason);
            }
            
            $this->client->apimanager()->endpoints->webhook->$method(...$args)->done(function () use ($resolve) {
                $resolve();
            }, $reject);
        }));
    }
function delete ( string $ reason = '' ) { return ( new \ React \ Promise \ Promise ( function ( callable $ resolve , callable $ reject ) use ( $ reason ) { $ method = 'deleteWebhook' ; $ args = array ( $ this -> id , $ reason ) ; if ( ! empty ( $ this -> token ) ) { $ method = 'deleteWebhookToken' ; $ args = array ( $ this -> id , $ this -> token , $ reason ) ; } $ this -> client -> apimanager ( ) -> endpoints -> webhook -> $ method ( ... $ args ) -> done ( function ( ) use ( $ resolve ) { $ resolve ( ) ; } , $ reject ) ; } ) ) ; }
Deletes the webhook.
@param string  $reason
@return \React\Promise\ExtendedPromiseInterface
Deletes the webhook .