1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Entities\InputMedia; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Entities\MessageEntity; |
6
|
|
|
use TelegramBot\Entity; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class InputMediaDocument |
10
|
|
|
* |
11
|
|
|
* @link https://core.telegram.org/bots/api#inputmediadocument |
12
|
|
|
* |
13
|
|
|
* <code> |
14
|
|
|
* $data = [ |
15
|
|
|
* 'media' => '123abc', |
16
|
|
|
* 'thumb' => '456def', |
17
|
|
|
* 'caption' => '*Document* caption', |
18
|
|
|
* 'parse_mode' => 'markdown', |
19
|
|
|
* ]; |
20
|
|
|
* </code> |
21
|
|
|
* |
22
|
|
|
* @method string getType() Type of the result, must be document |
23
|
|
|
* @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. |
24
|
|
|
* @method string getThumb() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » |
25
|
|
|
* @method string getCaption() Optional. Caption of the document to be sent, 0-200 characters |
26
|
|
|
* @method string getParseMode() Optional. Mode for parsing entities in the document caption |
27
|
|
|
* @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
28
|
|
|
* @method bool getDisableContentTypeDetection() Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album. |
29
|
|
|
* |
30
|
|
|
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. |
31
|
|
|
* @method $this setThumb(string $thumb) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » |
32
|
|
|
* @method $this setCaption(string $caption) Optional. Caption of the document to be sent, 0-200 characters |
33
|
|
|
* @method $this setParseMode(string $parse_mode) Optional. Mode for parsing entities in the document caption |
34
|
|
|
* @method $this setCaptionEntities(array $caption_entities) Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
35
|
|
|
* @method $this setDisableContentTypeDetection(bool $disable_content_type_detection) Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album. |
36
|
|
|
*/ |
37
|
|
|
class InputMediaDocument extends Entity implements InputMedia |
38
|
|
|
{ |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* InputMediaDocument constructor |
42
|
|
|
* |
43
|
|
|
* @param array $data |
44
|
|
|
*/ |
45
|
|
|
public function __construct(array $data = []) |
46
|
|
|
{ |
47
|
|
|
$data['type'] = 'document'; |
48
|
|
|
parent::__construct($data); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
} |
52
|
|
|
|