1 | <?php |
||
30 | class Keyboard extends Base |
||
31 | { |
||
32 | /** |
||
33 | * Make an Inline Keyboard |
||
34 | * |
||
35 | * @var bool |
||
36 | */ |
||
37 | protected $inline = false; |
||
38 | |||
39 | /** |
||
40 | * Make this keyboard inline, So it appears right next to the message it belongs to. |
||
41 | * |
||
42 | * @link https://core.telegram.org/bots/api#inlinekeyboardmarkup |
||
43 | * |
||
44 | * @return $this |
||
45 | */ |
||
46 | public function inline() |
||
52 | |||
53 | /** |
||
54 | * Determine if it's an inline keyboard. |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function isInlineKeyboard() |
||
62 | |||
63 | /** |
||
64 | * Create a new row in keyboard to add buttons. |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function row() |
||
79 | |||
80 | /** |
||
81 | * Represents one button of the Reply keyboard. |
||
82 | * |
||
83 | * For simple text buttons String can be used instead of an array. |
||
84 | * You can also utilise the fluent API to build the params payload. |
||
85 | * |
||
86 | * <code> |
||
87 | * $params = 'string' |
||
88 | * |
||
89 | * OR |
||
90 | * |
||
91 | * $params = [ |
||
92 | * 'text' => '', |
||
93 | * 'request_contact' => '', |
||
94 | * 'request_location' => '', |
||
95 | * ]; |
||
96 | * </code> |
||
97 | * |
||
98 | * @link https://core.telegram.org/bots/api#keyboardbutton |
||
99 | * |
||
100 | * @param string|array $params |
||
101 | * |
||
102 | * @var string $params ['text'] |
||
103 | * @var bool $params ['request_contact'] |
||
104 | * @var bool $params ['request_location'] |
||
105 | * |
||
106 | * @return mixed |
||
107 | */ |
||
108 | public static function button($params = []) |
||
116 | |||
117 | /** |
||
118 | * Represents one button of an inline keyboard. |
||
119 | * |
||
120 | * You must use exactly one of the optional fields. |
||
121 | * You can also utilise the fluent API to build the params payload. |
||
122 | * |
||
123 | * <code> |
||
124 | * $params = [ |
||
125 | * 'text' => '', |
||
126 | * 'url' => '', |
||
127 | * 'callback_data' => '', |
||
128 | * 'switch_inline_query' => '', |
||
129 | * ]; |
||
130 | * </code> |
||
131 | * |
||
132 | * @link https://core.telegram.org/bots/api#inlinekeyboardbutton |
||
133 | * |
||
134 | * @param string|array $params |
||
135 | * |
||
136 | * @var string $params ['text'] |
||
137 | * @var string $params ['url'] |
||
138 | * @var string $params ['callback_data'] |
||
139 | * @var string $params ['switch_inline_query'] |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public static function inlineButton($params = []) |
||
147 | |||
148 | /** |
||
149 | * Hide the current custom keyboard and display the default letter-keyboard. |
||
150 | * |
||
151 | * <code> |
||
152 | * $params = [ |
||
153 | * 'hide_keyboard' => true, |
||
154 | * 'selective' => false, |
||
155 | * ]; |
||
156 | * </code> |
||
157 | * |
||
158 | * @link https://core.telegram.org/bots/api#replykeyboardhide |
||
159 | * |
||
160 | * @param array $params |
||
161 | * |
||
162 | * @var bool $params ['hide_keyboard'] |
||
163 | * @var bool $params ['selective'] |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | public static function hide(array $params = []) |
||
171 | |||
172 | /** |
||
173 | * Display a reply interface to the user (act as if the user has selected the bot‘s message and tapped ’Reply'). |
||
174 | * |
||
175 | * <code> |
||
176 | * $params = [ |
||
177 | * 'force_reply' => true, |
||
178 | * 'selective' => false, |
||
179 | * ]; |
||
180 | * </code> |
||
181 | * |
||
182 | * @link https://core.telegram.org/bots/api#forcereply |
||
183 | * |
||
184 | * @param array $params |
||
185 | * |
||
186 | * @var bool $params ['force_reply'] |
||
187 | * @var bool $params ['selective'] |
||
188 | * |
||
189 | * @return string |
||
190 | */ |
||
191 | public static function forceReply(array $params = []) |
||
195 | } |
||
196 |