1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Created by PhpStorm. |
4
|
|
|
* User: iGusev |
5
|
|
|
* Date: 14/04/16 |
6
|
|
|
* Time: 14:41 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace TelegramBot\Api\Types\Inline\InputMessageContent; |
10
|
|
|
|
11
|
|
|
use TelegramBot\Api\TypeInterface; |
12
|
|
|
use TelegramBot\Api\Types\Inline\InputMessageContent; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Class Text |
16
|
|
|
* @see https://core.telegram.org/bots/api#inputtextmessagecontent |
17
|
|
|
* Represents the content of a text message to be sent as the result of an inline query. |
18
|
|
|
* |
19
|
|
|
* @package TelegramBot\Api\Types\Inline\InputMessageContent |
20
|
|
|
*/ |
21
|
|
|
class Text extends InputMessageContent implements TypeInterface |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* {@inheritdoc} |
25
|
|
|
* |
26
|
|
|
* @var array |
27
|
|
|
*/ |
28
|
|
|
protected static $requiredParams = ['message_text']; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* {@inheritdoc} |
32
|
|
|
* |
33
|
|
|
* @var array |
34
|
|
|
*/ |
35
|
|
|
protected static $map = [ |
36
|
|
|
'message_text' => true, |
37
|
|
|
'parse_mode' => true, |
38
|
|
|
'disable_web_page_preview' => true, |
39
|
|
|
]; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Text of the message to be sent, 1-4096 characters |
43
|
|
|
* |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
protected $messageText; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Optional. Send Markdown or HTML, |
50
|
|
|
* if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. |
51
|
|
|
* |
52
|
|
|
* @var string|null |
53
|
|
|
*/ |
54
|
|
|
protected $parseMode; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Optional. Disables link previews for links in the sent message |
58
|
|
|
* |
59
|
|
|
* @var bool|null |
60
|
|
|
*/ |
61
|
|
|
protected $disableWebPagePreview; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Text constructor. |
65
|
|
|
* @param string $messageText |
66
|
|
|
* @param string|null $parseMode |
67
|
|
|
* @param bool $disableWebPagePreview |
68
|
|
|
*/ |
69
|
|
|
public function __construct($messageText, $parseMode = null, $disableWebPagePreview = false) |
70
|
|
|
{ |
71
|
|
|
$this->messageText = $messageText; |
72
|
|
|
$this->parseMode = $parseMode; |
73
|
|
|
$this->disableWebPagePreview = $disableWebPagePreview; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return string |
78
|
|
|
*/ |
79
|
|
|
public function getMessageText() |
80
|
|
|
{ |
81
|
|
|
return $this->messageText; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param string $messageText |
86
|
|
|
* |
87
|
|
|
* @return void |
88
|
|
|
*/ |
89
|
|
|
public function setMessageText($messageText) |
90
|
|
|
{ |
91
|
|
|
$this->messageText = $messageText; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return string|null |
96
|
|
|
*/ |
97
|
|
|
public function getParseMode() |
98
|
|
|
{ |
99
|
|
|
return $this->parseMode; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param string|null $parseMode |
104
|
|
|
* |
105
|
|
|
* @return void |
106
|
|
|
*/ |
107
|
|
|
public function setParseMode($parseMode) |
108
|
|
|
{ |
109
|
|
|
$this->parseMode = $parseMode; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @return bool|null |
114
|
|
|
*/ |
115
|
|
|
public function isDisableWebPagePreview() |
116
|
|
|
{ |
117
|
|
|
return $this->disableWebPagePreview; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @param bool|null $disableWebPagePreview |
122
|
|
|
* |
123
|
|
|
* @return void |
124
|
|
|
*/ |
125
|
|
|
public function setDisableWebPagePreview($disableWebPagePreview) |
126
|
|
|
{ |
127
|
|
|
$this->disableWebPagePreview = $disableWebPagePreview; |
128
|
|
|
} |
129
|
|
|
} |
130
|
|
|
|