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 location on a map. By default, the location will be sent by the user. Alternatively, you can use |
12
|
|
|
* input_message_content to send a message with the specified content instead of the location. |
13
|
|
|
* |
14
|
|
|
* More on https://core.telegram.org/bots/api#inlinequeryresultlocation |
15
|
|
|
*/ |
16
|
|
|
class InlineQueryResultLocation extends InlineQueryResult |
17
|
|
|
{ |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Location latitude in degrees |
21
|
|
|
* |
22
|
|
|
* @var float number |
23
|
|
|
*/ |
24
|
|
|
private $latitude; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Location longitude in degrees |
28
|
|
|
* |
29
|
|
|
* @var float number |
30
|
|
|
*/ |
31
|
|
|
private $longitude; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Location title |
35
|
|
|
* |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
private $title; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Optional. The radius of uncertainty for the location, measured in meters; 0-1500 |
42
|
|
|
* |
43
|
|
|
* @since zanzara 0.5.0, Telegram Bot Api 5.0 |
44
|
|
|
* |
45
|
|
|
* @var float|null |
46
|
|
|
*/ |
47
|
|
|
private $horizontal_accuracy; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. |
51
|
|
|
* |
52
|
|
|
* @var int|null |
53
|
|
|
*/ |
54
|
|
|
private $live_period; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if |
58
|
|
|
* specified. |
59
|
|
|
* |
60
|
|
|
* @since zanzara 0.5.0, Telegram Bot Api 5.0 |
61
|
|
|
* |
62
|
|
|
* @var int|null |
63
|
|
|
*/ |
64
|
|
|
private $heading; |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in |
68
|
|
|
* meters. Must be between 1 and 100000 if specified. |
69
|
|
|
* |
70
|
|
|
* @since zanzara 0.5.0, Telegram Bot Api 5.0 |
71
|
|
|
* |
72
|
|
|
* @var int|null |
73
|
|
|
*/ |
74
|
|
|
private $proximity_alert_distance; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Optional. Inline keyboard attached to the message |
78
|
|
|
* |
79
|
|
|
* @var InlineKeyboardMarkup|null |
80
|
|
|
*/ |
81
|
|
|
private $reply_markup; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Optional. Content of the message to be sent instead of the location |
85
|
|
|
* |
86
|
|
|
* @var InputMessageContent|null |
87
|
|
|
*/ |
88
|
|
|
private $input_message_content; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Optional. Url of the thumbnail for the result |
92
|
|
|
* |
93
|
|
|
* @var string|null |
94
|
|
|
*/ |
95
|
|
|
private $thumb_url; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* Optional. Thumbnail width |
99
|
|
|
* |
100
|
|
|
* @var int|null |
101
|
|
|
*/ |
102
|
|
|
private $thumb_width; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Optional. Thumbnail height |
106
|
|
|
* |
107
|
|
|
* @var int|null |
108
|
|
|
*/ |
109
|
|
|
private $thumb_height; |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @return float |
113
|
|
|
*/ |
114
|
|
|
public function getLatitude(): float |
115
|
|
|
{ |
116
|
|
|
return $this->latitude; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @param float $latitude |
121
|
|
|
*/ |
122
|
|
|
public function setLatitude(float $latitude): void |
123
|
|
|
{ |
124
|
|
|
$this->latitude = $latitude; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @return float |
129
|
|
|
*/ |
130
|
|
|
public function getLongitude(): float |
131
|
|
|
{ |
132
|
|
|
return $this->longitude; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @param float $longitude |
137
|
|
|
*/ |
138
|
|
|
public function setLongitude(float $longitude): void |
139
|
|
|
{ |
140
|
|
|
$this->longitude = $longitude; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return string |
145
|
|
|
*/ |
146
|
|
|
public function getTitle(): string |
147
|
|
|
{ |
148
|
|
|
return $this->title; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @param string $title |
153
|
|
|
*/ |
154
|
|
|
public function setTitle(string $title): void |
155
|
|
|
{ |
156
|
|
|
$this->title = $title; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @return int|null |
161
|
|
|
*/ |
162
|
|
|
public function getLivePeriod(): ?int |
163
|
|
|
{ |
164
|
|
|
return $this->live_period; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @param int|null $live_period |
169
|
|
|
*/ |
170
|
|
|
public function setLivePeriod(?int $live_period): void |
171
|
|
|
{ |
172
|
|
|
$this->live_period = $live_period; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @return InlineKeyboardMarkup|null |
177
|
|
|
*/ |
178
|
|
|
public function getReplyMarkup(): ?InlineKeyboardMarkup |
179
|
|
|
{ |
180
|
|
|
return $this->reply_markup; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @param InlineKeyboardMarkup|null $reply_markup |
185
|
|
|
*/ |
186
|
|
|
public function setReplyMarkup(?InlineKeyboardMarkup $reply_markup): void |
187
|
|
|
{ |
188
|
|
|
$this->reply_markup = $reply_markup; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* @return InputMessageContent|null |
193
|
|
|
*/ |
194
|
|
|
public function getInputMessageContent(): ?InputMessageContent |
195
|
|
|
{ |
196
|
|
|
return $this->input_message_content; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @param InputMessageContent|null $input_message_content |
201
|
|
|
*/ |
202
|
|
|
public function setInputMessageContent(?InputMessageContent $input_message_content): void |
203
|
|
|
{ |
204
|
|
|
$this->input_message_content = $input_message_content; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @return string|null |
209
|
|
|
*/ |
210
|
|
|
public function getThumbUrl(): ?string |
211
|
|
|
{ |
212
|
|
|
return $this->thumb_url; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @param string|null $thumb_url |
217
|
|
|
*/ |
218
|
|
|
public function setThumbUrl(?string $thumb_url): void |
219
|
|
|
{ |
220
|
|
|
$this->thumb_url = $thumb_url; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* @return int|null |
225
|
|
|
*/ |
226
|
|
|
public function getThumbWidth(): ?int |
227
|
|
|
{ |
228
|
|
|
return $this->thumb_width; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* @param int|null $thumb_width |
233
|
|
|
*/ |
234
|
|
|
public function setThumbWidth(?int $thumb_width): void |
235
|
|
|
{ |
236
|
|
|
$this->thumb_width = $thumb_width; |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* @return int|null |
241
|
|
|
*/ |
242
|
|
|
public function getThumbHeight(): ?int |
243
|
|
|
{ |
244
|
|
|
return $this->thumb_height; |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* @param int|null $thumb_height |
249
|
|
|
*/ |
250
|
|
|
public function setThumbHeight(?int $thumb_height): void |
251
|
|
|
{ |
252
|
|
|
$this->thumb_height = $thumb_height; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* @return int|null |
257
|
|
|
*/ |
258
|
|
|
public function getHeading(): ?int |
259
|
|
|
{ |
260
|
|
|
return $this->heading; |
261
|
|
|
} |
262
|
|
|
|
263
|
|
|
/** |
264
|
|
|
* @param int|null $heading |
265
|
|
|
*/ |
266
|
|
|
public function setHeading(?int $heading): void |
267
|
|
|
{ |
268
|
|
|
$this->heading = $heading; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* @return int|null |
273
|
|
|
*/ |
274
|
|
|
public function getProximityAlertDistance(): ?int |
275
|
|
|
{ |
276
|
|
|
return $this->proximity_alert_distance; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* @param int|null $proximity_alert_distance |
281
|
|
|
*/ |
282
|
|
|
public function setProximityAlertDistance(?int $proximity_alert_distance): void |
283
|
|
|
{ |
284
|
|
|
$this->proximity_alert_distance = $proximity_alert_distance; |
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
/** |
288
|
|
|
* @return float|null |
289
|
|
|
*/ |
290
|
|
|
public function getHorizontalAccuracy(): ?float |
291
|
|
|
{ |
292
|
|
|
return $this->horizontal_accuracy; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* @param float|null $horizontal_accuracy |
297
|
|
|
*/ |
298
|
|
|
public function setHorizontalAccuracy(?float $horizontal_accuracy): void |
299
|
|
|
{ |
300
|
|
|
$this->horizontal_accuracy = $horizontal_accuracy; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
} |