Closed mehdivijeh closed 6 years ago
my code: $file_id = $message['photo'][0]['file_id']; $file = $telegram->getFile($file_id); $telegram->downloadFile($file['result']['file_path'], './product_pic.png');
$file_id = $message['photo'][0]['file_id']; $file = $telegram->getFile($file_id); $telegram->downloadFile($file['result']['file_path'], './product_pic.png');
and this is error error_code: 400 description: Bad Request: file id not specified
error_code: 400 description: Bad Request: file id not specified
$file_id has a value ? What's your PHP version ?
i add ['message'] at first of code and its work! $file_id = $message['message']['photo'][2]['file_id'];
$file_id = $message['message']['photo'][2]['file_id'];
my code:
$file_id = $message['photo'][0]['file_id']; $file = $telegram->getFile($file_id); $telegram->downloadFile($file['result']['file_path'], './product_pic.png');
and this is error
error_code: 400 description: Bad Request: file id not specified