To send a local photo, add it properly to the `$data` parameter using the file path:
To send a local photo, add it properly to the `$data` parameter using the file path:
```php
```php
$data=[
$result=Request::sendPhoto([
'chat_id'=>$chat_id,
'chat_id'=>$chat_id,
'photo'=>Request::encodeFile('/path/to/pic.jpg'),
'photo'=>Request::encodeFile('/path/to/pic.jpg'),
];
]);
$result=Request::sendPhoto($data);
```
```
If you know the `file_id` of a previously uploaded file, just use it directly in the data array:
If you know the `file_id` of a previously uploaded file, just use it directly in the data array:
```php
```php
$data=[
$result=Request::sendPhoto([
'chat_id'=>$chat_id,
'chat_id'=>$chat_id,
'photo'=>$file_id,
'photo'=>'AAQCCBNtIhAoAAss4tLEZ3x6HzqVAAqC',
];
]);
$result=Request::sendPhoto($data);
```
```
To send a remote photo, use the direct URL instead:
To send a remote photo, use the direct URL instead:
```php
```php
$data=[
$result=Request::sendPhoto([
'chat_id'=>$chat_id,
'chat_id'=>$chat_id,
'photo'=>'https://example.com/path/to/pic.jpg',
'photo'=>'https://example.com/path/to/pic.jpg',
];
]);
$result=Request::sendPhoto($data);
```
```
*sendAudio*, *sendDocument*, *sendSticker*, *sendVideo*, *sendVoice* and *sendVideoNote* all work in the same way, just check the [API documentation](https://core.telegram.org/bots/api#sendphoto) for the exact usage.
*sendAudio*, *sendDocument*, *sendSticker*, *sendVideo*, *sendVoice* and *sendVideoNote* all work in the same way, just check the [API documentation](https://core.telegram.org/bots/api#sendphoto) for the exact usage.
...
@@ -369,8 +370,8 @@ See the [*ImageCommand.php*][ImageCommand.php] for a full example.
...
@@ -369,8 +370,8 @@ See the [*ImageCommand.php*][ImageCommand.php] for a full example.