File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class InlineKeyboardButton extends Entity
1818 protected $ url ;
1919 protected $ callback_data ;
2020 protected $ switch_inline_query ;
21+ protected $ web_app ;
2122
2223
2324 /**
@@ -37,8 +38,8 @@ public function __construct($data = array())
3738 $ this ->url = isset ($ data ['url ' ]) ? $ data ['url ' ] : null ;
3839 $ this ->callback_data = isset ($ data ['callback_data ' ]) ? $ data ['callback_data ' ] : null ;
3940 $ this ->switch_inline_query = isset ($ data ['switch_inline_query ' ]) ? $ data ['switch_inline_query ' ] : null ;
40-
41- if ($ this ->url === '' && $ this ->callback_data === '' && $ this ->switch_inline_query === '' ) {
41+ $ this -> web_app = isset ( $ data [ ' web_app ' ]) ? $ data [ ' web_app ' ] : null ;
42+ if ($ this ->url === '' && $ this ->callback_data === '' && $ this ->switch_inline_query === '' && $ this -> web_app === '' ) {
4243 throw new TelegramException ('You must use at least one of these fields: url, callback_data, switch_inline_query! ' );
4344 }
4445 }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * This file is part of the TelegramBot package.
4+ *
5+ * (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
6+ *
7+ * For the full copyright and license information, please view the LICENSE
8+ * file that was distributed with this source code.
9+ */
10+
11+ namespace Longman \TelegramBot \Entities ;
12+
13+ use Longman \TelegramBot \Exception \TelegramException ;
14+
15+ class WebAppInfo extends Entity
16+ {
17+ protected $ url ;
18+
19+ /**
20+ * WebAppInfo constructor.
21+ *
22+ * @param array $data
23+ */
24+ public function __construct ($ data = array ())
25+ {
26+ $ this ->url = isset ($ data ['url ' ]) ? $ data ['url ' ] : null ;
27+ if (empty ($ this ->url )) {
28+ throw new TelegramException ('url is empty! ' );
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments