Example #1
0
 /**
  * setWebhook
  * Use this method to specify a url and receive incoming updates via an outgoing webhook.
  *
  * @param string    $url
  * @param InputFile $certificate
  *
  * @return array
  */
 public function setWebhook($url = '', $certificate = null)
 {
     $params = [];
     if ($url) {
         $params['url'] = $url;
     }
     if ($certificate instanceof InputFile) {
         $params['certificate'] = $certificate;
     }
     $json = $this->Telegram->getNet()->doRequest('/setWebhook', $params);
     return json_decode($json, true);
 }