src/Api.php
public function setWebhook(array $params)
    {
        if (filter_var($params['url'], FILTER_VALIDATE_URL) === false) {
            throw new TelegramSDKException('Invalid URL Provided');
        }

        if (parse_url($params['url'], PHP_URL_SCHEME) !== 'https') {
            throw new TelegramSDKException('Invalid URL, should be a HTTPS url.');
        }

        return $this->uploadFile('setWebhook', $params);
    }
public function setWebhook(array $params)
    {
        if (filter_var($params['url'], FILTER_VALIDATE_URL) === false) {
            throw new TelegramSDKException('Invalid URL Provided');
        }

        if (parse_url($params['url'], PHP_URL_SCHEME) !== 'https') {
            throw new TelegramSDKException('Invalid URL, should be a HTTPS url.');
        }

        return $this->uploadFile('setWebhook', $params);
    }
public function setWebhook ( array $ params ) { if ( filter_var ( $ params [ 'url' ] , FILTER_VALIDATE_URL ) === false ) { throw new TelegramSDKException ( 'Invalid URL Provided' ) ; } if ( parse_url ( $ params [ 'url' ] , PHP_URL_SCHEME ) !== 'https' ) { throw new TelegramSDKException ( 'Invalid URL, should be a HTTPS url.' ) ; } return $ this -> uploadFile ( 'setWebhook' , $ params ) ; }
Set a Webhook to receive incoming updates via an outgoing webhook.

<code>
$params = [
'url'         => '',
'certificate' => '',
];
</code>

@link https://core.telegram.org/bots/api#setwebhook

@param array $params

@var string  $params ['url']         HTTPS url to send updates to.
@var string  $params ['certificate'] Upload your public key certificate so that the root certificate in
use can be checked.

@throws TelegramSDKException

@return TelegramResponse
Set a Webhook to receive incoming updates via an outgoing webhook .