1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the TelegramBot package. |
5
|
|
|
* |
6
|
|
|
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Longman\TelegramBot\Entities; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Class Poll |
16
|
|
|
* |
17
|
|
|
* This entity contains information about a poll. |
18
|
|
|
* |
19
|
|
|
* @link https://core.telegram.org/bots/api#poll |
20
|
|
|
* |
21
|
|
|
* @method string getId() Unique poll identifier |
22
|
|
|
* @method string getQuestion() Poll question, 1-255 characters |
23
|
|
|
* @method PollOption[] getOptions() List of poll options |
24
|
|
|
* @method int getTotalVoterCount() Total number of users that voted in the poll |
25
|
|
|
* @method bool getIsClosed() True, if the poll is closed |
26
|
|
|
* @method bool getIsAnonymous() True, if the poll is anonymous |
27
|
|
|
* @method string getType() Poll type, currently can be “regular” or “quiz” |
28
|
|
|
* @method bool getAllowsMultipleAnswers() True, if the poll allows multiple answers |
29
|
|
|
* @method int getCorrectOptionId() Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. |
30
|
|
|
* @method string getExplanation() Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters |
31
|
|
|
* @method MessageEntity[] getExplanationEntities() Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation |
32
|
|
|
* @method int getOpenPeriod() Optional. Amount of time in seconds the poll will be active after creation |
33
|
|
|
* @method int getCloseDate() Optional. Point in time (Unix timestamp) when the poll will be automatically closed |
34
|
|
|
*/ |
35
|
|
|
class Poll extends Entity |
36
|
|
|
{ |
37
|
|
|
/** |
38
|
|
|
* {@inheritdoc} |
39
|
|
|
*/ |
40
|
|
|
protected function subEntities(): array |
41
|
|
|
{ |
42
|
|
|
return [ |
43
|
|
|
'options' => [PollOption::class], |
44
|
|
|
'explanation_entities' => [MessageEntity::class], |
45
|
|
|
]; |
46
|
|
|
} |
47
|
|
|
} |
48
|
|
|
|