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