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:
346
349
347
350
```php
348
-
$data = [
351
+
$result = Request::sendPhoto([
349
352
'chat_id' => $chat_id,
350
-
'photo' => $file_id,
351
-
];
352
-
$result = Request::sendPhoto($data);
353
+
'photo' => 'AAQCCBNtIhAoAAss4tLEZ3x6HzqVAAqC',
354
+
]);
353
355
```
354
356
355
357
To send a remote photo, use the direct URL instead:
356
358
357
359
```php
358
-
$data = [
360
+
$result = Request::sendPhoto([
359
361
'chat_id' => $chat_id,
360
362
'photo' => 'https://example.com/path/to/pic.jpg',
361
-
];
362
-
$result = Request::sendPhoto($data);
363
+
]);
363
364
```
364
365
365
366
*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.
@@ -368,7 +369,10 @@ See the [*ImageCommand.php*][ImageCommand.php] for a full example.
0 commit comments