@@ 15-88 (lines=74) @@ | ||
12 | * |
|
13 | * @package TelegramBot\Api\Types |
|
14 | */ |
|
15 | class ForceReply extends BaseType |
|
16 | { |
|
17 | /** |
|
18 | * {@inheritdoc} |
|
19 | * |
|
20 | * @var array |
|
21 | */ |
|
22 | static protected $requiredParams = ['force_reply']; |
|
23 | ||
24 | /** |
|
25 | * {@inheritdoc} |
|
26 | * |
|
27 | * @var array |
|
28 | */ |
|
29 | static protected $map = [ |
|
30 | 'force_reply' => true, |
|
31 | 'selective' => true |
|
32 | ]; |
|
33 | ||
34 | /** |
|
35 | * Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply' |
|
36 | * |
|
37 | * @var bool |
|
38 | */ |
|
39 | protected $forceReply; |
|
40 | ||
41 | /** |
|
42 | * Optional. Use this parameter if you want to show the keyboard to 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($forceReply = true, $selective = null) |
|
52 | { |
|
53 | $this->forceReply = $forceReply; |
|
54 | $this->selective = $selective; |
|
55 | } |
|
56 | ||
57 | /** |
|
58 | * @return boolean |
|
59 | */ |
|
60 | public function isForceReply() |
|
61 | { |
|
62 | return $this->forceReply; |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * @param boolean $forceReply |
|
67 | */ |
|
68 | public function setForceReply($forceReply) |
|
69 | { |
|
70 | $this->forceReply = $forceReply; |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * @return boolean |
|
75 | */ |
|
76 | public function isSelective() |
|
77 | { |
|
78 | return $this->selective; |
|
79 | } |
|
80 | ||
81 | /** |
|
82 | * @param boolean $selective |
|
83 | */ |
|
84 | public function setSelective($selective) |
|
85 | { |
|
86 | $this->selective = $selective; |
|
87 | } |
|
88 | } |
|
89 |
@@ 16-89 (lines=74) @@ | ||
13 | * |
|
14 | * @package TelegramBot\Api\Types |
|
15 | */ |
|
16 | class ReplyKeyboardHide extends BaseType |
|
17 | { |
|
18 | /** |
|
19 | * {@inheritdoc} |
|
20 | * |
|
21 | * @var array |
|
22 | */ |
|
23 | static protected $requiredParams = ['hide_keyboard']; |
|
24 | ||
25 | /** |
|
26 | * {@inheritdoc} |
|
27 | * |
|
28 | * @var array |
|
29 | */ |
|
30 | static protected $map = [ |
|
31 | 'hide_keyboard' => true, |
|
32 | 'selective' => true |
|
33 | ]; |
|
34 | ||
35 | /** |
|
36 | * Requests clients to hide the custom keyboard |
|
37 | * |
|
38 | * @var bool |
|
39 | */ |
|
40 | protected $hideKeyboard; |
|
41 | ||
42 | /** |
|
43 | * Optional. Use this parameter if you want to show the keyboard to specific users only. |
|
44 | * Targets: |
|
45 | * 1) users that are @mentioned in the text of the Message object; |
|
46 | * 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. |
|
47 | * |
|
48 | * @var bool |
|
49 | */ |
|
50 | protected $selective; |
|
51 | ||
52 | public function __construct($hideKeyboard = true, $selective = null) |
|
53 | { |
|
54 | $this->hideKeyboard = $hideKeyboard; |
|
55 | $this->selective = $selective; |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * @return boolean |
|
60 | */ |
|
61 | public function isHideKeyboard() |
|
62 | { |
|
63 | return $this->hideKeyboard; |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @param boolean $hideKeyboard |
|
68 | */ |
|
69 | public function setHideKeyboard($hideKeyboard) |
|
70 | { |
|
71 | $this->hideKeyboard = $hideKeyboard; |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * @return boolean |
|
76 | */ |
|
77 | public function isSelective() |
|
78 | { |
|
79 | return $this->selective; |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * @param boolean $selective |
|
84 | */ |
|
85 | public function setSelective($selective) |
|
86 | { |
|
87 | $this->selective = $selective; |
|
88 | } |
|
89 | } |
|
90 |
@@ 14-88 (lines=75) @@ | ||
11 | * |
|
12 | * @package TelegramBot\Api\Types |
|
13 | */ |
|
14 | 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 |