|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types; |
|
4
|
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* @deprecated Use ReplyKeyboardRemove |
|
9
|
|
|
* |
|
10
|
|
|
* Class ReplyKeyboardHide |
|
11
|
|
|
* Upon receiving a message with this object, Telegram clients will hide the current custom keyboard |
|
12
|
|
|
* and display the default letter-keyboard. By default, custom keyboards are displayed |
|
13
|
|
|
* until a new keyboard is sent by a bot. An exception is made for one-time keyboards |
|
14
|
|
|
* that are hidden immediately after the user presses a button (see \TelegramBot\Api\Types\ReplyKeyboardMarkup). |
|
15
|
|
|
* |
|
16
|
|
|
* @package TelegramBot\Api\Types |
|
17
|
|
|
*/ |
|
18
|
|
|
class ReplyKeyboardHide extends BaseType |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* {@inheritdoc} |
|
22
|
|
|
* |
|
23
|
|
|
* @var array |
|
24
|
|
|
*/ |
|
25
|
|
|
protected static $requiredParams = ['hide_keyboard']; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* {@inheritdoc} |
|
29
|
|
|
* |
|
30
|
|
|
* @var array |
|
31
|
|
|
*/ |
|
32
|
|
|
protected static $map = [ |
|
33
|
|
|
'hide_keyboard' => true, |
|
34
|
|
|
'selective' => true |
|
35
|
|
|
]; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Requests clients to hide the custom keyboard |
|
39
|
|
|
* |
|
40
|
|
|
* @var bool |
|
41
|
|
|
*/ |
|
42
|
|
|
protected $hideKeyboard; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Optional. Use this parameter if you want to show the keyboard to specific users only. |
|
46
|
|
|
* Targets: |
|
47
|
|
|
* 1) users that are @mentioned in the text of the Message object; |
|
48
|
|
|
* 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. |
|
49
|
|
|
* |
|
50
|
|
|
* @var bool|null |
|
51
|
|
|
*/ |
|
52
|
12 |
|
protected $selective; |
|
53
|
|
|
|
|
54
|
12 |
|
/** |
|
55
|
12 |
|
* @param bool $hideKeyboard |
|
56
|
12 |
|
* @param bool|null $selective |
|
57
|
|
|
*/ |
|
58
|
|
|
public function __construct($hideKeyboard = true, $selective = null) |
|
59
|
|
|
{ |
|
60
|
|
|
$this->hideKeyboard = $hideKeyboard; |
|
61
|
1 |
|
$this->selective = $selective; |
|
62
|
|
|
} |
|
63
|
1 |
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @return bool |
|
66
|
|
|
*/ |
|
67
|
|
|
public function isHideKeyboard() |
|
68
|
|
|
{ |
|
69
|
2 |
|
return $this->hideKeyboard; |
|
70
|
|
|
} |
|
71
|
2 |
|
|
|
72
|
2 |
|
/** |
|
73
|
|
|
* @param bool $hideKeyboard |
|
74
|
|
|
* @return void |
|
75
|
|
|
*/ |
|
76
|
|
|
public function setHideKeyboard($hideKeyboard) |
|
77
|
1 |
|
{ |
|
78
|
|
|
$this->hideKeyboard = $hideKeyboard; |
|
79
|
1 |
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @return bool|null |
|
83
|
|
|
*/ |
|
84
|
|
|
public function isSelective() |
|
85
|
2 |
|
{ |
|
86
|
|
|
return $this->selective; |
|
87
|
2 |
|
} |
|
88
|
2 |
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @param bool $selective |
|
91
|
|
|
* @return void |
|
92
|
|
|
*/ |
|
93
|
|
|
public function setSelective($selective) |
|
94
|
|
|
{ |
|
95
|
|
|
$this->selective = $selective; |
|
96
|
|
|
} |
|
97
|
|
|
} |
|
98
|
|
|
|