You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you know the `file_id` of a previously uploaded file, just use it directly in the data array:
347
350
348
351
```php
349
-
$data = [
352
+
$result = Request::sendPhoto([
350
353
'chat_id' => $chat_id,
351
-
'photo' => $file_id,
352
-
];
353
-
$result = Request::sendPhoto($data);
354
+
'photo' => 'AAQCCBNtIhAoAAss4tLEZ3x6HzqVAAqC',
355
+
]);
354
356
```
355
357
356
358
To send a remote photo, use the direct URL instead:
357
359
358
360
```php
359
-
$data = [
361
+
$result = Request::sendPhoto([
360
362
'chat_id' => $chat_id,
361
363
'photo' => 'https://example.com/path/to/pic.jpg',
362
-
];
363
-
$result = Request::sendPhoto($data);
364
+
]);
364
365
```
365
366
366
367
*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,7 +370,10 @@ See the [*ImageCommand.php*][ImageCommand.php] for a full example.
0 commit comments