1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Zanzara\Telegram\Type\InlineQueryResult; |
6
|
|
|
|
7
|
|
|
use Zanzara\Telegram\Type\Input\InputMessageContent; |
8
|
|
|
use Zanzara\Telegram\Type\Keyboard\InlineKeyboardMarkup; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, |
12
|
|
|
* you can use input_message_content to send a message with the specified content instead of the file. Currently, |
13
|
|
|
* only .PDF and .ZIP files can be sent using this method. |
14
|
|
|
* |
15
|
|
|
* More on https://core.telegram.org/bots/api#inlinequeryresultdocument |
16
|
|
|
*/ |
17
|
|
|
class InlineQueryResultDocument extends InlineQueryResult |
18
|
|
|
{ |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Title for the result |
22
|
|
|
* |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
private $title; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Optional. Caption of the document to be sent, 0-1024 characters after entities parsing |
29
|
|
|
* |
30
|
|
|
* @var string|null |
31
|
|
|
*/ |
32
|
|
|
private $caption; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in |
36
|
|
|
* the media caption. |
37
|
|
|
* |
38
|
|
|
* @var string|null |
39
|
|
|
*/ |
40
|
|
|
private $parse_mode; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
44
|
|
|
* |
45
|
|
|
* @since zanzara 0.5.0, Telegram Bot Api 5.0 |
46
|
|
|
* |
47
|
|
|
* @var \Zanzara\Telegram\Type\MessageEntity[]|null |
48
|
|
|
*/ |
49
|
|
|
private $caption_entities; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* A valid URL for the file |
53
|
|
|
* |
54
|
|
|
* @var string |
55
|
|
|
*/ |
56
|
|
|
private $document_url; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Mime type of the content of the file, either "application/pdf" or "application/zip" |
60
|
|
|
* |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
private $mime_type; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Optional. Short description of the result |
67
|
|
|
* |
68
|
|
|
* @var string|null |
69
|
|
|
*/ |
70
|
|
|
private $description; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Optional. Inline keyboard attached to the message |
74
|
|
|
* |
75
|
|
|
* @var InlineKeyboardMarkup|null |
76
|
|
|
*/ |
77
|
|
|
private $reply_markup; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Optional. Content of the message to be sent instead of the file |
81
|
|
|
* |
82
|
|
|
* @var InputMessageContent|null |
83
|
|
|
*/ |
84
|
|
|
private $input_message_content; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Optional. URL of the thumbnail (jpeg only) for the file |
88
|
|
|
* |
89
|
|
|
* @var string|null |
90
|
|
|
*/ |
91
|
|
|
private $thumb_url; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Optional. Thumbnail width |
95
|
|
|
* |
96
|
|
|
* @var int|null |
97
|
|
|
*/ |
98
|
|
|
private $thumb_width; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Optional. Thumbnail height |
102
|
|
|
* |
103
|
|
|
* @var int|null |
104
|
|
|
*/ |
105
|
|
|
private $thumb_height; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return string |
109
|
|
|
*/ |
110
|
|
|
public function getTitle(): string |
111
|
|
|
{ |
112
|
|
|
return $this->title; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @param string $title |
117
|
|
|
*/ |
118
|
|
|
public function setTitle(string $title): void |
119
|
|
|
{ |
120
|
|
|
$this->title = $title; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @return string|null |
125
|
|
|
*/ |
126
|
|
|
public function getCaption(): ?string |
127
|
|
|
{ |
128
|
|
|
return $this->caption; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @param string|null $caption |
133
|
|
|
*/ |
134
|
|
|
public function setCaption(?string $caption): void |
135
|
|
|
{ |
136
|
|
|
$this->caption = $caption; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @return string|null |
141
|
|
|
*/ |
142
|
|
|
public function getParseMode(): ?string |
143
|
|
|
{ |
144
|
|
|
return $this->parse_mode; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @param string|null $parse_mode |
149
|
|
|
*/ |
150
|
|
|
public function setParseMode(?string $parse_mode): void |
151
|
|
|
{ |
152
|
|
|
$this->parse_mode = $parse_mode; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @return string |
157
|
|
|
*/ |
158
|
|
|
public function getDocumentUrl(): string |
159
|
|
|
{ |
160
|
|
|
return $this->document_url; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @param string $document_url |
165
|
|
|
*/ |
166
|
|
|
public function setDocumentUrl(string $document_url): void |
167
|
|
|
{ |
168
|
|
|
$this->document_url = $document_url; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @return string |
173
|
|
|
*/ |
174
|
|
|
public function getMimeType(): string |
175
|
|
|
{ |
176
|
|
|
return $this->mime_type; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @param string $mime_type |
181
|
|
|
*/ |
182
|
|
|
public function setMimeType(string $mime_type): void |
183
|
|
|
{ |
184
|
|
|
$this->mime_type = $mime_type; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @return string|null |
189
|
|
|
*/ |
190
|
|
|
public function getDescription(): ?string |
191
|
|
|
{ |
192
|
|
|
return $this->description; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* @param string|null $description |
197
|
|
|
*/ |
198
|
|
|
public function setDescription(?string $description): void |
199
|
|
|
{ |
200
|
|
|
$this->description = $description; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @return InlineKeyboardMarkup|null |
205
|
|
|
*/ |
206
|
|
|
public function getReplyMarkup(): ?InlineKeyboardMarkup |
207
|
|
|
{ |
208
|
|
|
return $this->reply_markup; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* @param InlineKeyboardMarkup|null $reply_markup |
213
|
|
|
*/ |
214
|
|
|
public function setReplyMarkup(?InlineKeyboardMarkup $reply_markup): void |
215
|
|
|
{ |
216
|
|
|
$this->reply_markup = $reply_markup; |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* @return InputMessageContent|null |
221
|
|
|
*/ |
222
|
|
|
public function getInputMessageContent(): ?InputMessageContent |
223
|
|
|
{ |
224
|
|
|
return $this->input_message_content; |
225
|
|
|
} |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @param InputMessageContent|null $input_message_content |
229
|
|
|
*/ |
230
|
|
|
public function setInputMessageContent(?InputMessageContent $input_message_content): void |
231
|
|
|
{ |
232
|
|
|
$this->input_message_content = $input_message_content; |
233
|
|
|
} |
234
|
|
|
|
235
|
|
|
/** |
236
|
|
|
* @return string|null |
237
|
|
|
*/ |
238
|
|
|
public function getThumbUrl(): ?string |
239
|
|
|
{ |
240
|
|
|
return $this->thumb_url; |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @param string|null $thumb_url |
245
|
|
|
*/ |
246
|
|
|
public function setThumbUrl(?string $thumb_url): void |
247
|
|
|
{ |
248
|
|
|
$this->thumb_url = $thumb_url; |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* @return int|null |
253
|
|
|
*/ |
254
|
|
|
public function getThumbWidth(): ?int |
255
|
|
|
{ |
256
|
|
|
return $this->thumb_width; |
257
|
|
|
} |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* @param int|null $thumb_width |
261
|
|
|
*/ |
262
|
|
|
public function setThumbWidth(?int $thumb_width): void |
263
|
|
|
{ |
264
|
|
|
$this->thumb_width = $thumb_width; |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* @return int|null |
269
|
|
|
*/ |
270
|
|
|
public function getThumbHeight(): ?int |
271
|
|
|
{ |
272
|
|
|
return $this->thumb_height; |
273
|
|
|
} |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* @param int|null $thumb_height |
277
|
|
|
*/ |
278
|
|
|
public function setThumbHeight(?int $thumb_height): void |
279
|
|
|
{ |
280
|
|
|
$this->thumb_height = $thumb_height; |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* @return \Zanzara\Telegram\Type\MessageEntity[]|null |
285
|
|
|
*/ |
286
|
|
|
public function getCaptionEntities(): ?array |
287
|
|
|
{ |
288
|
|
|
return $this->caption_entities; |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
/** |
292
|
|
|
* @param \Zanzara\Telegram\Type\MessageEntity[]|null $caption_entities |
293
|
|
|
*/ |
294
|
|
|
public function setCaptionEntities(?array $caption_entities): void |
295
|
|
|
{ |
296
|
|
|
$this->caption_entities = $caption_entities; |
297
|
|
|
} |
298
|
|
|
|
299
|
|
|
} |