private function getFiles()
    {
        $file = $this->event->get('document');

        $response = $this->http->get($this->buildApiUrl('getFile'), [
            'file_id' => $file['file_id'],
        ]);

        $responseData = json_decode($response->getContent());

        if ($response->getStatusCode() !== 200) {
            throw new TelegramAttachmentException('Error retrieving file url: '.$responseData->description);
        }

        $url = $this->buildFileApiUrl($responseData->result->file_path);

        return [new File($url, $file)];
    }
private function getFiles()
    {
        $file = $this->event->get('document');

        $response = $this->http->get($this->buildApiUrl('getFile'), [
            'file_id' => $file['file_id'],
        ]);

        $responseData = json_decode($response->getContent());

        if ($response->getStatusCode() !== 200) {
            throw new TelegramAttachmentException('Error retrieving file url: '.$responseData->description);
        }

        $url = $this->buildFileApiUrl($responseData->result->file_path);

        return [new File($url, $file)];
    }
private function getFiles ( ) { $ file = $ this -> event -> get ( 'document' ) ; $ response = $ this -> http -> get ( $ this -> buildApiUrl ( 'getFile' ) , [ 'file_id' => $ file [ 'file_id' ] , ] ) ; $ responseData = json_decode ( $ response -> getContent ( ) ) ; if ( $ response -> getStatusCode ( ) !== 200 ) { throw new TelegramAttachmentException ( 'Error retrieving file url: ' . $ responseData -> description ) ; } $ url = $ this -> buildFileApiUrl ( $ responseData -> result -> file_path ) ; return [ new File ( $ url , $ file ) ] ; }
Retrieve a file from an incoming message.
@return array A download for the files.
@throws TelegramAttachmentException
Retrieve a file from an incoming message .