Completed
Push — master ( 770142...55698b )
by Armando
01:37
created

InputMediaDocument::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of the TelegramBot package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\TelegramBot\Entities\InputMedia;
12
13
use Longman\TelegramBot\Entities\Entity;
14
15
/**
16
 * Class InputMediaDocument
17
 *
18
 * @link https://core.telegram.org/bots/api#inputmediadocument
19
 *
20
 * <code>
21
 * $data = [
22
 *   'media'      => '123abc',
23
 *   'thumb'      => '456def',
24
 *   'caption'    => '*Document* caption',
25
 *   'parse_mode' => 'markdown',
26
 * ];
27
 * </code>
28
 *
29
 * @method string getType()      Type of the result, must be document
30
 * @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.
31
 * @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 »
32
 * @method string getCaption()   Optional. Caption of the document to be sent, 0-200 characters
33
 * @method string getParseMode() Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
34
 *
35
 * @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.
36
 * @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 »
37
 * @method $this setCaption(string $caption)      Optional. Caption of the document to be sent, 0-200 characters
38
 * @method $this setParseMode(string $parse_mode) Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
39
 */
40
class InputMediaDocument extends Entity implements InputMedia
41
{
42
    /**
43
     * InputMediaDocument constructor
44
     *
45
     * @param array $data
46
     *
47
     * @throws \Longman\TelegramBot\Exception\TelegramException
48
     */
49
    public function __construct(array $data = [])
50
    {
51
        $data['type'] = 'document';
52
        parent::__construct($data);
53
    }
54
}
55