|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types; |
|
4
|
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class ReplyKeyboardRemove |
|
9
|
|
|
* Upon receiving a message with this object, |
|
10
|
|
|
* Telegram clients will remove the current custom keyboard and display the default letter-keyboard. |
|
11
|
|
|
* |
|
12
|
|
|
* @package TelegramBot\Api\Types |
|
13
|
|
|
*/ |
|
14
|
|
View Code Duplication |
class ReplyKeyboardRemove extends BaseType |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* {@inheritdoc} |
|
18
|
|
|
* |
|
19
|
|
|
* @var array |
|
20
|
|
|
*/ |
|
21
|
|
|
static protected $requiredParams = ['remove_keyboard']; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* {@inheritdoc} |
|
25
|
|
|
* |
|
26
|
|
|
* @var array |
|
27
|
|
|
*/ |
|
28
|
|
|
static protected $map = [ |
|
29
|
|
|
'remove_keyboard' => true, |
|
30
|
|
|
'selective' => true |
|
31
|
|
|
]; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; |
|
35
|
|
|
* if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) |
|
36
|
|
|
* |
|
37
|
|
|
* @var bool |
|
38
|
|
|
*/ |
|
39
|
|
|
protected $remove_keyboard; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Optional. Use this parameter if you want to remove the keyboard for specific users only. |
|
43
|
|
|
* Targets: |
|
44
|
|
|
* 1) users that are @mentioned in the text of the Message object; |
|
45
|
|
|
* 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. |
|
46
|
|
|
* |
|
47
|
|
|
* @var bool |
|
48
|
|
|
*/ |
|
49
|
|
|
protected $selective; |
|
50
|
|
|
|
|
51
|
|
|
public function __construct($remove_keyboard = true, $selective = false) |
|
52
|
|
|
{ |
|
53
|
|
|
$this->remove_keyboard = $remove_keyboard; |
|
54
|
|
|
$this->selective = $selective; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @return bool |
|
59
|
|
|
*/ |
|
60
|
|
|
public function getRemoveKeyboard() |
|
61
|
|
|
{ |
|
62
|
|
|
return $this->remove_keyboard; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @param bool $remove_keyboard |
|
67
|
|
|
*/ |
|
68
|
|
|
public function setRemoveKeyboard($remove_keyboard) |
|
69
|
|
|
{ |
|
70
|
|
|
$this->remove_keyboard = $remove_keyboard; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @return bool |
|
75
|
|
|
*/ |
|
76
|
|
|
public function getSelective() |
|
77
|
|
|
{ |
|
78
|
|
|
return $this->selective; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @param bool $selective |
|
83
|
|
|
*/ |
|
84
|
|
|
public function setSelective($selective) |
|
85
|
|
|
{ |
|
86
|
|
|
$this->selective = $selective; |
|
87
|
|
|
} |
|
88
|
|
|
} |
|
89
|
|
|
|