Completed
Push — master ( 24b2c2...c2a3d2 )
by Camilo
11s
created

SendAnimation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 87
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMandatoryFields() 0 7 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Methods;
6
7
use unreal4u\TelegramAPI\Abstracts\KeyboardMethods;
8
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
9
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
10
11
/**
12
 * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message
13
 * is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
14
 *
15
 * Objects defined as-is July 2018
16
 *
17
 * @see https://core.telegram.org/bots/api#sendanimation
18
 */
19
class SendAnimation extends TelegramMethods
20
{
21
    /**
22
     * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
23
     * @var string
24
     */
25
    public $chat_id = '';
26
27
    /**
28
     * Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers
29
     * (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new
30
     * one using the InputFile class
31
     *
32
     * @see InputFile
33
     * @var string|InputFile
34
     */
35
    public $animation = '';
36
37
    /**
38
     * Duration of sent animation in seconds
39
     * @var int
40
     */
41
    public $duration = 0;
42
43
    /**
44
     * Animation width
45
     * @var int
46
     */
47
    public $width = 0;
48
49
    /**
50
     * Animation height
51
     * @var int
52
     */
53
    public $height = 0;
54
55
    /**
56
     * Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A
57
     * thumbnail's width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data.
58
     * Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>"
59
     * if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
60
     * @var string|InputFile
61
     */
62
    public $thumb;
63
64
    /**
65
     * Optional. Animation caption (may also be used when resending animation by file_id), 0-200 characters
66
     * @var string
67
     */
68
    public $caption = '';
69
70
    /**
71
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs
72
     * in the media caption
73
     * @var string
74
     */
75
    public $parse_mode = '';
76
77
    /**
78
     * Optional. Sends the message silently. iOS users will not receive a notification, Android users will receive a
79
     * notification with no sound.
80
     * @see https://telegram.org/blog/channels-2-0#silent-messages
81
     * @var bool
82
     */
83
    public $disable_notification = false;
84
85
    /**
86
     * Optional. If the message is a reply, ID of the original message
87
     * @var int
88
     */
89
    public $reply_to_message_id = 0;
90
91
    /**
92
     * Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to
93
     * hide keyboard or to force a reply from the user
94
     * @var KeyboardMethods
95
     */
96
    public $reply_markup;
97
98
    public function getMandatoryFields(): array
99
    {
100
        return [
101
            'chat_id',
102
            'animation',
103
        ];
104
    }
105
}
106