Skip to content

Commit 9b526e7

Browse files
docs File download feature
1 parent 21a0a8a commit 9b526e7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Telegram Bot PHP is a PHP Library for interaction with [Telegram Bot API](https:
2222
- [Example](#example)
2323
- [Error](#error)
2424
- [Request](#request)
25+
- [Download File](#download-file)
2526
- [Helper](#helper)
2627
- [Format](#format)
2728
- [Exceptions](#exceptions)
@@ -640,6 +641,26 @@ $response->getRequestMethod(); // get request method name (sendMessage)
640641
$response->getRequestParameters(); // get request parameters as an array (['chat_id' => '184171927', 'text' => 'Example Text'])
641642

642643
```
644+
645+
# Download File
646+
```php
647+
648+
$bot->downloadFile('documents/example.txt', __DIR__ . '/documents/example.txt');
649+
650+
// or
651+
652+
Bot::downloadFile('documents/example.txt', __DIR__ . '/documents/example.txt');
653+
654+
// download file by file_id
655+
656+
$bot->downloadFileByFileId('BQACAgQAAxkBAAJ0T2EJUDHTeXGcSBUrqFMgzZCQ0OJGAAIhCQACg2tJUEqm6016cXE9IAQ', __DIR__ . '/documents/example.txt');
657+
658+
// or
659+
660+
Bot::downloadFileByFileId('BQACAgQAAxkBAAJ0T2EJUDHTeXGcSBUrqFMgzZCQ0OJGAAIhCQACg2tJUEqm6016cXE9IAQ', __DIR__ . '/documents/example.txt');
661+
662+
```
663+
643664
## Helper
644665
Helpers are auxiliary functions for receiving certain values or checking some items or doing certain tasks
645666

0 commit comments

Comments
 (0)