/var/www/myprog.com.ua/telegram/webhooks/vendor/telegram-bot/api/src
NameSizeModeActions
Collection/-0755rm
Events/-0755rm
Types/-0755rm
BadMethodCallException.php1810644editdlrm
BaseType.php24500644editdlrm
Botan.php20270644editdlrm
BotApi.php612110644editdlrm
Client.php111600644editdlrm
Exception.php1560644editdlrm
HttpException.php9450644editdlrm
InvalidArgumentException.php1850644editdlrm
InvalidJsonException.php1770644editdlrm
TypeInterface.php1110644editdlrm
Edit: /var/www/myprog.com.ua/telegram/webhooks/vendor/telegram-bot/api/src/Botan.php (2027B)
token = $token; $this->curl = curl_init(); } /** * Event tracking * * @param \TelegramBot\Api\Types\Message $message * @param string $eventName * * @throws \TelegramBot\Api\Exception * @throws \TelegramBot\Api\HttpException */ public function track(Message $message, $eventName = 'Message') { $uid = $message->getFrom()->getId(); $options = [ CURLOPT_URL => self::BASE_URL . "?token={$this->token}&uid={$uid}&name={$eventName}", CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => $message->toJson(), CURLOPT_TIMEOUT => 5, ]; curl_setopt_array($this->curl, $options); $result = BotApi::jsonValidate(curl_exec($this->curl), true); BotApi::curlValidate($this->curl); if ($result['status'] !== 'accepted') { throw new Exception('Error Processing Request'); } } /** * Destructor. Close curl */ public function __destruct() { $this->curl && curl_close($this->curl); } }