|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Zanzara\Telegram\Type\Input; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Represents a general file to be sent. |
|
9
|
|
|
* |
|
10
|
|
|
* More on https://core.telegram.org/bots/api#inputmediadocument |
|
11
|
|
|
*/ |
|
12
|
|
|
class InputMediaDocument |
|
13
|
|
|
{ |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Type of the result, must be document |
|
17
|
|
|
* |
|
18
|
|
|
* @var string |
|
19
|
|
|
*/ |
|
20
|
|
|
private $type; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for |
|
24
|
|
|
* Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using |
|
25
|
|
|
* multipart/form-data under <file_attach_name> name. More info on Sending Files >> |
|
26
|
|
|
* |
|
27
|
|
|
* @var string |
|
28
|
|
|
*/ |
|
29
|
|
|
private $media; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. |
|
33
|
|
|
* The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not |
|
34
|
|
|
* exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be |
|
35
|
|
|
* only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using |
|
36
|
|
|
* multipart/form-data under <file_attach_name>. More info on Sending Files >> |
|
37
|
|
|
* |
|
38
|
|
|
* @var InputFile or String|null |
|
39
|
|
|
*/ |
|
40
|
|
|
private $thumb; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Optional. Caption of the document to be sent, 0-1024 characters after entities parsing |
|
44
|
|
|
* |
|
45
|
|
|
* @var string|null |
|
46
|
|
|
*/ |
|
47
|
|
|
private $caption; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in |
|
51
|
|
|
* the media caption. |
|
52
|
|
|
* |
|
53
|
|
|
* @var string|null |
|
54
|
|
|
*/ |
|
55
|
|
|
private $parse_mode; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
|
59
|
|
|
* |
|
60
|
|
|
* @var \Zanzara\Telegram\Type\MessageEntity[] |
|
61
|
|
|
*/ |
|
62
|
|
|
private $caption_entities; |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. |
|
66
|
|
|
* Always true, if the document is sent as part of an album. |
|
67
|
|
|
* |
|
68
|
|
|
* @since zanzara 0.5.0, Telegram Bot Api 5.0 |
|
69
|
|
|
* |
|
70
|
|
|
* @var bool|null |
|
71
|
|
|
*/ |
|
72
|
|
|
private $disable_content_type_detection; |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return string |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getType(): string |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->type; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @param string $type |
|
84
|
|
|
*/ |
|
85
|
|
|
public function setType(string $type): void |
|
86
|
|
|
{ |
|
87
|
|
|
$this->type = $type; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @return string |
|
92
|
|
|
*/ |
|
93
|
|
|
public function getMedia(): string |
|
94
|
|
|
{ |
|
95
|
|
|
return $this->media; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @param string $media |
|
100
|
|
|
*/ |
|
101
|
|
|
public function setMedia(string $media): void |
|
102
|
|
|
{ |
|
103
|
|
|
$this->media = $media; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @return InputFile |
|
108
|
|
|
*/ |
|
109
|
|
|
public function getThumb(): InputFile |
|
110
|
|
|
{ |
|
111
|
|
|
return $this->thumb; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @param InputFile $thumb |
|
116
|
|
|
*/ |
|
117
|
|
|
public function setThumb(InputFile $thumb): void |
|
118
|
|
|
{ |
|
119
|
|
|
$this->thumb = $thumb; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @return string|null |
|
124
|
|
|
*/ |
|
125
|
|
|
public function getCaption(): ?string |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->caption; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* @param string|null $caption |
|
132
|
|
|
*/ |
|
133
|
|
|
public function setCaption(?string $caption): void |
|
134
|
|
|
{ |
|
135
|
|
|
$this->caption = $caption; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* @return string|null |
|
140
|
|
|
*/ |
|
141
|
|
|
public function getParseMode(): ?string |
|
142
|
|
|
{ |
|
143
|
|
|
return $this->parse_mode; |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
/** |
|
147
|
|
|
* @param string|null $parse_mode |
|
148
|
|
|
*/ |
|
149
|
|
|
public function setParseMode(?string $parse_mode): void |
|
150
|
|
|
{ |
|
151
|
|
|
$this->parse_mode = $parse_mode; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* @return \Zanzara\Telegram\Type\MessageEntity[] |
|
156
|
|
|
*/ |
|
157
|
|
|
public function getCaptionEntities(): array |
|
158
|
|
|
{ |
|
159
|
|
|
return $this->caption_entities; |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
/** |
|
163
|
|
|
* @param \Zanzara\Telegram\Type\MessageEntity[] $caption_entities |
|
164
|
|
|
*/ |
|
165
|
|
|
public function setCaptionEntities(array $caption_entities): void |
|
166
|
|
|
{ |
|
167
|
|
|
$this->caption_entities = $caption_entities; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
/** |
|
171
|
|
|
* @return bool|null |
|
172
|
|
|
*/ |
|
173
|
|
|
public function getDisableContentTypeDetection(): ?bool |
|
174
|
|
|
{ |
|
175
|
|
|
return $this->disable_content_type_detection; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* @param bool|null $disable_content_type_detection |
|
180
|
|
|
*/ |
|
181
|
|
|
public function setDisableContentTypeDetection(?bool $disable_content_type_detection): void |
|
182
|
|
|
{ |
|
183
|
|
|
$this->disable_content_type_detection = $disable_content_type_detection; |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
} |