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 InputMediaAnimation |
17
|
|
|
* |
18
|
|
|
* @link https://core.telegram.org/bots/api#inputmediaanimation |
19
|
|
|
* |
20
|
|
|
* <code> |
21
|
|
|
* $data = [ |
22
|
|
|
* 'media' => '123abc', |
23
|
|
|
* 'thumb' => '456def', |
24
|
|
|
* 'caption' => '*Animation* caption', |
25
|
|
|
* 'parse_mode' => 'markdown', |
26
|
|
|
* 'width' => 200, |
27
|
|
|
* 'height' => 150, |
28
|
|
|
* 'duration' => 11, |
29
|
|
|
* ]; |
30
|
|
|
* </code> |
31
|
|
|
* |
32
|
|
|
* @method string getType() Type of the result, must be animation |
33
|
|
|
* @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. More info on Sending Files » |
34
|
|
|
* @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 » |
35
|
|
|
* @method string getCaption() Optional. Caption of the animation to be sent, 0-200 characters |
36
|
|
|
* @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. |
37
|
|
|
* @method int getWidth() Optional. Animation width |
38
|
|
|
* @method int getHeight() Optional. Animation height |
39
|
|
|
* @method int getDuration() Optional. Animation duration |
40
|
|
|
* |
41
|
|
|
* @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. More info on Sending Files » |
42
|
|
|
* @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 » |
43
|
|
|
* @method $this setCaption(string $caption) Optional. Caption of the animation to be sent, 0-200 characters |
44
|
|
|
* @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. |
45
|
|
|
* @method $this setWidth(int $width) Optional. Animation width |
46
|
|
|
* @method $this setHeight(int $height) Optional. Animation height |
47
|
|
|
* @method $this setDuration(int $duration) Optional. Animation duration |
48
|
|
|
*/ |
49
|
|
|
class InputMediaAnimation extends Entity implements InputMedia |
50
|
|
|
{ |
51
|
|
|
/** |
52
|
|
|
* InputMediaAnimation constructor |
53
|
|
|
* |
54
|
|
|
* @param array $data |
55
|
|
|
* |
56
|
|
|
* @throws \Longman\TelegramBot\Exception\TelegramException |
57
|
|
|
*/ |
58
|
|
|
public function __construct(array $data = []) |
59
|
|
|
{ |
60
|
|
|
$data['type'] = 'animation'; |
61
|
|
|
parent::__construct($data); |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|